Videos
Iโm new to Go and finding it really hard to reference the official documentation โThe Spec and Effective Goโ while writing code. The examples are often ambiguous and unclear, and itโs tough to understand how to use/understand things in real situations.
I struggle to check syntax, methods, and built-in functionalities just by reading the docs. I usually end up using ChatGPT
For more experienced Go developers โ how do you actually read and use the documentation? And what is your reference go to when you program? How do you find what you need? Any tips and suggestions would be appreciated.
Factsheet
Rob Pike
Ken Thompson
Rob Pike
Ken Thompson
You should use standard // comments because this is what the official documentation tool called godoc will use to generate documentation for your go code. You can have a look at this post from the official golang blog about it: http://blog.golang.org/godoc-documenting-go-code
I also found this quite interesting: https://godoc.org/github.com/natefinch/godocgo
You should use standard // and the first word must be the name of function package (for generator) .
golang doc :
Notice this comment is a complete sentence that begins with the name of the element it describes. This important convention allows us to generate documentation