utils

package
v0.0.0-...-0570cf9 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append[E any](d *[]E, v ...E)

func ArrAntiSuffix

func ArrAntiSuffix[V any](v []V, count int) []V

ArrAntiSuffix returns all but count last elements

func Last

func Last[V any](v []V) V

func MergeMap

func MergeMap[K comparable, V any](
	dest map[K]V,
	source map[K]V,
)

func NamedReturns

func NamedReturns(spec *ast.FuncType) []*ast.Ident

func P

func P[V any](v V) *V

func PopMap

func PopMap[K comparable, V any](m map[K]V, key K) V

func Remove

func Remove[E any](d *[]E, start int, count int)

func ScanTypeTags

func ScanTypeTags(p *analysis.Pass)

func UpdateMap

func UpdateMap[K comparable, V any](
	m map[K]V,
	key K,
	updater func(v V, exists bool) V,
)

func Walk

func Walk[S any](n ast.Node, preVisitor func(n ast.Node) (S, bool), postVisitor func(stored S, n ast.Node))

func WalkWithCrumbs

func WalkWithCrumbs(n ast.Node, visitor func(n ast.Node, crumbs []ast.Node) bool)

Types

type ChecksFact

type ChecksFact map[string]bool

func GetTypeTags

func GetTypeTags(p *analysis.Pass, o types.Object) ChecksFact

func (*ChecksFact) AFact

func (*ChecksFact) AFact()

Jump to

Keyboard shortcuts

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