noinit

package module
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 5 Imported by: 0

README

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`).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL