Documentation
¶
Overview ¶
Package golden provides shared helpers for golden-file (snapshot) tests.
A golden test captures rendered output as a checked-in .golden file so the output is reviewable as a diff in PRs and regenerated on demand with -update. This package holds the generic machinery (the -update flag, ANSI stripping, file compare with a readable diff) so any command can golden its output by supplying only its own scenarios. See internal/cli/stack/sync_golden_test.go for a worked example.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Update = flag.Bool("update", false, "update golden files")
Update reports whether golden files should be regenerated. Enable it with `go test ./... -update`. Go compiles each package's tests into a separate binary, so this flag is registered independently per test binary and does not collide with -update flags defined in other packages.
Functions ¶
Types ¶
This section is empty.