Documentation
¶
Overview ¶
Package composite holds mutators that operate on composite literals (struct, map, and keyed array/slice literals).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MutatorFieldClear ¶
MutatorFieldClear drops one keyed element from a composite literal, letting the field fall back to its zero value:
Config{Timeout: 30, Retries: 3} → Config{Retries: 3}
map[string]int{"a": 1, "b": 2} → map[string]int{"b": 2}
This targets fields that are set to a meaningful (non-zero) value but never asserted by any test — a pervasive shape in generated Go, where an options or config struct is populated in full yet only one or two fields actually matter to the test suite. One mutation is emitted per non-zero keyed element.
Elements whose value already looks like the zero value (0, "", false, nil) are skipped: dropping them produces an identical-behaviour mutant that would always survive and add noise rather than signal. Positional (unkeyed) elements are skipped too, since removing one shifts the remaining elements and changes meaning unpredictably.
Types ¶
This section is empty.