utils

package
v0.0.0-...-453b246 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 4 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 TryEachInstr

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

Types

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