filter

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeCollector

type NodeCollector interface {
	Collect(file *ast.File, fset *token.FileSet, fileAbs string)
}

NodeCollector defines the interface for types that can collect and process AST nodes from a source file.

type NodeFilter

type NodeFilter interface {
	ShouldSkip(node ast.Node, mutatorName string) bool
}

NodeFilter defines the interface for types that can determine if an AST node should be excluded from mutation.

type SkipMakeArgsFilter

type SkipMakeArgsFilter struct {
	// IgnoredNodes maps positions of numeric literals to their parent 'make' call expressions
	IgnoredNodes map[token.Pos]*ast.CallExpr
}

SkipMakeArgsFilter is a filter that tracks numeric arguments in 'make' calls for slices and maps to be ignored during mutation.

func NewSkipMakeArgsFilter

func NewSkipMakeArgsFilter() *SkipMakeArgsFilter

NewSkipMakeArgsFilter creates and returns a new initialized Processor.

func (*SkipMakeArgsFilter) Collect

func (s *SkipMakeArgsFilter) Collect(file *ast.File, _ *token.FileSet, _ string)

Collect collects numeric arguments (children) from 'make' calls (parents) for slices/maps to be ignored during mutation

func (*SkipMakeArgsFilter) ShouldSkip

func (s *SkipMakeArgsFilter) ShouldSkip(node ast.Node, _ string) bool

ShouldSkip determines whether a given AST node should be skipped during mutation.

Jump to

Keyboard shortcuts

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