Skip to content
public-library›Rules›Go›Define every domain field, and comment other struct fields whose meaning the type does not show

Define every domain field, and comment other struct fields whose meaning the type does not show

In domain types, give every field a one-sentence comment defining what the term means in this domain, including units, scope, and lifecycle when they apply; when the field's type is a reusable domain type, the comment states only the field's role and extra constraints. Outside domain types, comment a field only when its meaning includes a durable fact that its name and type cannot express, and skip fields whose name and type already say everything.

In the full rule