Linting
- Extend
.golangci.yml to the wider default-quality set: complexity, security,
context and correctness linters (gosec, gocognit, cyclop, funlen, noctx,
bodyclose, contextcheck, exhaustive and others) alongside errcheck,
wrapcheck and errorlint.
- Enforce
gofumpt and gci formatting; make lint-fix applies them.
- No
//nolint directives: split the CLI dispatch, provider collection,
code emission, injector generation and file generation into focused
functions to satisfy the strict thresholds; harden init file permissions;
exclude the two unavoidable generator gosec paths in configuration.
- Keep targeted exemptions only: infallible in-memory writers for errcheck
and test files for complexity/duplication linters.
make check runs the full set; a lint-fix target was added to the Makefile.
Upgrade notes
- Requires Go 1.27.1+; public declaration signatures, generated output and
the JSON graph schema are unchanged.
whyor init now creates the package directory 0750 and the skeleton
0600 (owner-only). Re-running init on an existing file still fails.
- No
//nolint is used; local lint configuration can rely on the shipped
.golangci.yml thresholds.
go install github.com/Medzoner/whyor/cmd/whyor@v0.12.1
go get github.com/Medzoner/whyor@v0.12.1
whyor gen ./...
go test ./...