gounion

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:      "gounion",
	Doc:       "checks exhaustiveness of type switches on union interfaces",
	Run:       run,
	Requires:  []*analysis.Analyzer{inspect.Analyzer},
	FactTypes: []analysis.Fact{new(UnionInterface)},
}

Analyzer is the gounion analyzer that checks exhaustiveness of type switches on union interfaces (interfaces with private marker methods).

Functions

func New

func New(settings any) (register.LinterPlugin, error)

New creates a new gounion plugin instance for golangci-lint.

Types

type UnionInterface

type UnionInterface struct {
	MarkerMethod string   // e.g., "isNode"
	Members      []string // e.g., ["*BadExpr", "*Ident", "*BasicLit"]
}

UnionInterface is a Fact indicating that an interface is a union type with a private marker method and a set of implementing types.

func (*UnionInterface) AFact

func (*UnionInterface) AFact()

AFact implements the analysis.Fact interface.

Jump to

Keyboard shortcuts

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