News for hackers. Stuff that matters.
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.

There are no comments on this comment yet.