toolsgolang.org/x/tools/internal/gofix/findgofix Index | Files

package findgofix

import "golang.org/x/tools/internal/gofix/findgofix"

Package findgofix searches for and validates go:fix directives. The internal/gofix package uses findgofix to perform inlining. The go/analysis/passes/gofix package uses findgofix to check for problems with go:fix directives.

findgofix is separate from gofix to avoid depending on refactor/inline, which is large.

Index

Functions

func Find

func Find(pass *analysis.Pass, root cursor.Cursor, h Handler)

Find finds functions and constants annotated with an appropriate "//go:fix" comment (the syntax proposed by #32816), and calls handler methods for each one. h may be nil.

Types

type Handler

type Handler interface {
	HandleFunc(*ast.FuncDecl)
	HandleAlias(*ast.TypeSpec)
	HandleConst(name, rhs *ast.Ident)
}

A Handler handles language entities with go:fix directives.

Source Files

findgofix.go

Version
v0.33.0 (latest)
Published
May 5, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
7 hours ago

Tools for package owners.