Documentation
¶
Overview ¶
Package noinit provides a go/analysis analyzer that forbids a package-level func init, per the gomatic Go standard that favors explicit construction and dependency injection over implicit package initialization.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "noinit", Doc: "reports a package-level func init, which the gomatic Go standard forbids in favor of explicit construction / dependency injection", Requires: []*analysis.Analyzer{inspect.Analyzer}, Run: run, }
Analyzer reports every package-level func init.
View Source
var Registration = goyze.Registration{ Name: "noinit", Categories: []goyze.Category{"patterns"}, URL: "https://docs.gomatic.dev/yze/noinit", Analyzer: Analyzer, }
Registration declares this analyzer to the yze framework.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
yze-go-noinit
command
Command yze-go-noinit runs the noinit analyzer as a standalone go/analysis checker (text and -json output, and usable as a `go vet -vettool`).
|
Command yze-go-noinit runs the noinit analyzer as a standalone go/analysis checker (text and -json output, and usable as a `go vet -vettool`). |
Click to show internal directories.
Click to hide internal directories.