doc: guidelines for comment directives #43776
This issue shares some resemblance with #13560. It is about properly documenting a pretty widespread convention regarding comment text.
It is unofficially encouraged that other Go tools use a similar "namespace" prefix for their comment directives. For example,
I think we should more formally define what this format should look like, so that one can programmatically tell if a comment line is a directive. For example, one could imagine
This would help tools which use directives be more consistent, as well as tools which want to inspect all comments and directives in source code. For example, gofumpt does this now, and it takes some effort to tell if a comment is a directive.
I don't really mind where this is documented, as long as it's somewhere relatively authoritative. The wording doesn't have to be strong - after all, a Go comment can contain any plaintext. But it should still encourage tools to follow the format, for the sake of consistency.
The text was updated successfully, but these errors were encountered: