Why do i have to use serverHandler struct?

While trying to understand http package, I see below

serverHandler{c.server}.ServeHTTP(w, w.req)

which is basically below,

type serverHandler struct {
	srv *Server
}

and c.server is bascially srv *Server

type conn struct {
	// server is the server on which the connection arrived.
	// Immutable; never nil.
	server *Server

SO, instead of doing above, is below doing the samething?

      *c.server.ServeHTTP(w,w.req)
4 Likes

I think you are confusing go (programming language) with go (board game).

This forum is about the board game.

4 Likes

ok sorry, I google golang forum and I got here… My mistake

7 Likes

Well after you solve your problem, you’re welcome here to discover and play with us, welcome.

7 Likes

will do. thank you.

4 Likes