toolshonnef.co/go/tools/analysis/facts/generated Index | Files

package generated

import "honnef.co/go/tools/analysis/facts/generated"

Index

Variables

var Analyzer = &analysis.Analyzer{
	Name: "isgenerated",
	Doc:  "annotate file names that have been code generated",
	Run: func(pass *analysis.Pass) (interface{}, error) {
		m := map[string]Generator{}
		for _, f := range pass.Files {
			path := pass.Fset.PositionFor(f.Pos(), false).Filename
			g, ok := isGenerated(path)
			if ok {
				m[path] = g
			}
		}
		return m, nil
	},
	RunDespiteErrors: true,
	ResultType:       reflect.TypeOf(map[string]Generator{}),
}

Types

type Generator

type Generator int
const (
	Unknown Generator = iota
	Goyacc
	Cgo
	Stringer
	ProtocGenGo
)

A list of known generators we can detect

Source Files

generated.go

Version
v0.6.1 (latest)
Published
Mar 5, 2025
Platform
js/wasm
Imports
7 packages
Last checked
3 hours ago

Tools for package owners.