Hey guys I'm learning go and it's very exciting! one thing that I don't understand is how time.After works. In the docs this is the definition https://golang.org/pkg/time/#example_After
func After(d Duration) <-chan Time
in the actual source code, it looks like this:
func (t Time) After(u Time) bool
Why don't I see the definition that looks more like the docs with channels? Am I looking at the wrong thing?
https://github.com/golang/go/blob/master/src/time/time.go
评论:
anossov:
lems2:Yes, you're looking at (Time) After
time.After is in sleep.go
You can click on the function name in the docs to go to the source.
djherbis:thanks! I wasn't even aware you could click on function names! they really need to make it look like a link or something
anossov:One hint that looks reliable is underline on hover.
TheMerovius:Everything that's blue is a link.
No, this is wrong, specifically for godoc. Looking, for example, at this, the global Header isn't a link, the section headers aren't, the "type/func" parts of headers aren't, neither are the receiver parts of the headers.
I agree that, personally, I never found it hard to identify links in the doc, but you shouldn't shut down someone who does by saying "everything that's blue", especially if it's not even correct.
