Repository navigation
v0.23.1
·
6 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
This release changes only the documentation and the distributed skills. The analyzer, shrink and the subcommands behave as in v0.23.0.
Skills
The authoring skill now says when a directive belongs on the whole and when on each declaration, and how a verb namespace can mislead (#350).
| Topic | Guidance |
|---|---|
A file-level or block //declscope:shared |
Write one only when the file or block is shared by nature, such as a utility file or the package's shared model. When many declarations are used from other files only for now, mark each of them instead |
Many surplus reports under one file-level or block directive |
Delete that directive, and mark the few declarations other files use. Do not let -fix fill the file with //declscope:private. The adoption skill says the same before a first -fix run |
| A struct whose fields other files read | Whether other files spell the type decides its directive, not how many fields cross. An unexported type they spell gets //declscope:shared. An exported type gets none, and a type only a constructor hands out stays private. In both, mark each field that is read |
| A name that starts with a verb namespace | It reads as that action. A function in delete.go that only checks must not be deleteUser. Use canDeleteUser or usersToDelete |
| A verb file name | Still fine. Regular noun and past forms already carry it: collect.go is carried by collectedFiles and addToCollection. A form that changes the spelling, such as deletion, needs another fit or a vocabulary entry |
README
- The
defaults.unexportedexample listsshared | private, notpackage | private(#349).