On Sun, Jun 27, 2021 at 5:25 PM Victor Giordano <vitucho3...@gmail.com> wrote:

> If you see here you will find a definition for a function.

This defines type `HandlerFunc`:
https://github.com/golang/go/blob/37f9a8f69d6299783eac8848d87e27eb563500ac/src/net/http/server.go#L2042

> Then if you look here you will find that definition again as the type for the 
> second argument.

This defines method `HandlerFunc` of type `*ServeMux`:
https://github.com/golang/go/blob/37f9a8f69d6299783eac8848d87e27eb563500ac/src/net/http/server.go#L2473

Both definitions share the same name `HandlerFunc`, but are not
binding the name to the same thing. One is a type name, the other is a
name of method attached to a type. The names are defined in different
namespaces.

I suggest taking a look at the language specification at
https://golang.org/ref/spec. It's IME and IMO the best starting point
for learning Go.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-UsAQaKTDrfyar7hFqkKUxSRTSrZupMfh2wXTqNJ_BBgQ%40mail.gmail.com.

Reply via email to