Skip to content
public-library›Rules›Go›Give exported Go identifiers and non-obvious functions doc comments stating their intent

Give exported Go identifiers and non-obvious functions doc comments stating their intent

Give every exported identifier a doc comment that starts with its name and states its intent: what it accomplishes for its caller, not how, and every guarantee callers depend on. Give an unexported function the same kind of comment when its intent or constraints aren't apparent from its name and signature.

In the full rule