I came across a discussion on slack where someone was pretty confused about various corners of godoc. I wrote a blog post (well, 4 actually, but I’ve only published one of them so far) about some of the things that came up in the discussion.
I didn’t think to post a link to it here, but when I shared it with the original poster, they said they thought other people would enjoy it, so here it is:
Good job! Another topic I see pop up on Stackoverflow every month is finding out which Types satisfy an Interface and vice versa. I always end up pointing people to https://golang.org/lib/godoc/analysis/help.html, but it definitely needs some more attention.
The reason for “go doc” is that it is designed for command-line use. Godoc is a web server first and a command-line tool as little more than an afterthought.
From the command line go doc is more convenient, has better defaults, and has some rudimentary search capability. Also, and perhaps most important, it has Go-like syntax: You write “go doc gob.Decoder” not “godoc encoding/gob Decoder”.
With godoc.org, godoc, go doc, and go/doc, I bet it can be very confusing for beginners so it’s important to single out the distinctive features and reasons for each.