The documentation is great, but sometimes it is hard to find a specific keyword. For instance, searching for Next()
results in this page http://golang.org/search?q=next%28%29 which is not very helpful. Is there a better way to search the documentation?
Rob Pike wrote the perfect tool for this. Install it with go
:
go get code.google.com/p/rspace.cmd/doc
You can then say doc next
(or doc Next
) and get an awesome list of Next
functions in all packages, along with their documentations and signature. If you know the name of the package, you can say doc sql next
or doc sql.next
. You can even pass -url
to get URL of that documentation online, or -src
to get file name and line number for the implementation of that symbol.
You can access package documentation (documentation that appears at the top of a package’s page and doesn’t belong to any of its items) with -pkg
: doc -pkg json
.
doc
searches for everything and you can limit it to only search for functions, interfaces, variables, etc. Run it without arguments to get the docs.
It’s such a great tool. Keep it close when you’re writing in Go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With