yze — gomatic analyzer family

yze is the gomatic analyzer family: a suite of go/analysis analyzers that encode the gomatic Go standards (sentinel error constants, value receivers, named parameter types, the three-tier CLI layout, …), built on a shared framework so each analyzer is a small, uniform repository. The stickler runner orchestrates this suite alongside golangci-lint; see docs.stickler for the runner.

Architecture

go-yze            framework library (diagnostic schema, registration, fix engine, checker driver)
yze-<name>        one analyzer per repo (e.g. yze-errconst)
yze               aggregator multichecker — runs the suite, emits stickler-json

Analyzers are flat-named yze-<name> (there is no language segment — the suite is all Go), and each emits the stable rule id yze/<name>. Analyzers carry category tags (errors, naming, types, immutability, structure, patterns, testing, …) as metadata, used for --category filtering and these docs.

Components

RuleWhat it enforcesCategory
yze/errconstno errors.New / fmt.Errorf — wrap via errs.Const.With (exempt defaults to go-error itself)errors
yze/errlasterror is the last return valueerrors
yze/gotostmtno gotopatterns
yze/ctxfirstcontext.Context is the first parameterpatterns
yze/namedtypesnamed domain types for parameterstypes
yze/anonstructno anonymous struct typestypes / structure
yze/emptyifaceany, not interface{} (autofix)modern-go
yze/boolnameboolean predicate/flag namingnaming
yze/ptrrecvvalue receivers (no pointer receivers without a no-copy field)immutability
yze/ptrparamvalue parameters (no pointer params except idiomatic stdlib)immutability
yze/stdloglog/slog, not the log packagedata
yze/pkgstdthree-tier command-package standards (per-package)structure
yze/layoutthree-tier command↔domain correspondence (cross-package)structure
yze/testfileunit-test files 1:1 with sourcetesting

Configuration

ptrrecv and ptrparam accept a configurable -allow list of additional types. Settings flow through yze --config (or stickler’s layered config), keyed by analyzer name.

Fixes

Analyzers attach native analysis.SuggestedFix edits when a safe, deterministic fix exists; the shared go-yze ApplyFixes engine applies them (yze --fix), and gopls surfaces them as editor quick-fixes for free.