News for hackers. Stuff that matters.
Re:Learn Go in five minutes by Thaxll on Tuesday January 05, 2021 @12:12PM (#25647755)
init() is not a convention and it's not used that much. For comments I don't understand what you're saying. And for caps I think it's better than public / private keyword.
Re:Learn Go in five minutes by fwip on Tuesday January 05, 2021 @12:22PM (#25647911)
Certain comments have a special meaning to some tooling. In this sense, it's not very different from Javadocs.

For some examples: A comment that appears right before a type or function definition is exported as documentation by the "go doc" tool.

Another one is build constraints, which appear as a comment at the top of the file, like: `// +build linux` to say "only include this file if the build target is linux."

Other tools use their own comment format to recognize comments meant for them.