gofixdirective

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Find

func Find(pass *analysis.Pass, root inspector.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.

Jump to

Keyboard shortcuts

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