toolshonnef.co/go/tools/analysis/callcheck Index | Files

package callcheck

import "honnef.co/go/tools/analysis/callcheck"

Package callcheck provides a framework for validating arguments in function calls.

Index

Functions

func Analyzer

func Analyzer(rules map[string]Check) func(pass *analysis.Pass) (interface{}, error)

func ExtractConst

func ExtractConst(v Value) *ir.Const

func ExtractConstExpectKind

func ExtractConstExpectKind(v Value, kind constant.Kind) *ir.Const

Types

type Argument

type Argument struct {
	Value Value
	// contains filtered or unexported fields
}

func (*Argument) Invalid

func (arg *Argument) Invalid(msg string)

type Call

type Call struct {
	Pass  *analysis.Pass
	Instr ir.CallInstruction
	Args  []*Argument

	Parent *ir.Function
	// contains filtered or unexported fields
}

func (*Call) Invalid

func (c *Call) Invalid(msg string)

type Check

type Check func(call *Call)

type Value

type Value struct {
	Value ir.Value
}

Source Files

callcheck.go

Version
v0.6.0-0.dev
Published
Aug 13, 2024
Platform
windows/amd64
Imports
10 packages
Last checked
26 minutes ago

Tools for package owners.