golden

package
v1.58.8 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MPL-2.0 Imports: 6 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

func Setup added in v1.10.0

func Setup()

Setup sets up the golden testing functionality for the package. It can be called instead of TestMain if a package wants to do multiple main function handling.

func Test

func Test(t testing.TB, output string)

Test checks the test output against the golden file where the path to the golden file is based on the test name; i.e. `testName.golden` within the `testdata` folder. If -golden-update was passed to "go test", it writes new golden files instead.

func TestAgainst added in v1.1.0

func TestAgainst(t testing.TB, goldenFileName string, output string)

TestAgainst checks the test output against the golden file. If -golden-update was passed to "go test", it writes new golden files instead.

func TestMain

func TestMain(m *testing.M)

TestMain sets up the golden testing functionality for the package. Packages that want to integrate golden testing should themselves implement TestMain and call this function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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