utils

package
v0.0.0-...-d38ec11 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EachInstr

func EachInstr(fn *ssa.Function, visitor func(ssa.Instruction)) error

func IsError

func IsError(t types.Type) bool

func IsTestRelatedFile

func IsTestRelatedFile(file *ast.File) bool

func TryEachInstr

func TryEachInstr(fn *ssa.Function, visitor func(ssa.Instruction) error) error

Types

type BuiltinFuncCallMatcher

type BuiltinFuncCallMatcher struct {
	FuncName string
}

func NewBuiltinFuncCallMatcher

func NewBuiltinFuncCallMatcher(funcName string) BuiltinFuncCallMatcher

func (BuiltinFuncCallMatcher) Matches

func (m BuiltinFuncCallMatcher) Matches(pass *analysis.Pass, call *ast.CallExpr) bool

func (BuiltinFuncCallMatcher) MatchesSSA

func (m BuiltinFuncCallMatcher) MatchesSSA(common *ssa.CallCommon) bool

type CallMatcher

type CallMatcher interface {
	Matches(*analysis.Pass, *ast.CallExpr) bool
	MatchesSSA(*ssa.CallCommon) bool
}

type PkgFuncCallMatcher

type PkgFuncCallMatcher struct {
	PkgPath  string
	FuncName string
}

func NewPkgFuncCallMatcher

func NewPkgFuncCallMatcher(pkgPath, funcName string) PkgFuncCallMatcher

func (PkgFuncCallMatcher) Matches

func (m PkgFuncCallMatcher) Matches(pass *analysis.Pass, call *ast.CallExpr) bool

func (PkgFuncCallMatcher) MatchesSSA

func (m PkgFuncCallMatcher) MatchesSSA(common *ssa.CallCommon) bool

type Set

type Set[T comparable] map[T]struct{}

func NewSet

func NewSet[T comparable]() Set[T]

func (Set[T]) Add

func (s Set[T]) Add(v T)

func (Set[T]) Has

func (s Set[T]) Has(v T) bool

func (Set[T]) ToSlice

func (s Set[T]) ToSlice() []T

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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