apidump

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package apidump extracts a package's exported API as a stable, sorted list of signature lines and checks it against a committed golden file. It is the mechanism behind the API-baseline tests that pin a package's public surface: any change to an exported type, function, method, constant, or variable shows up as a failing test with a diff, so a breaking change can never land silently — the concrete meaning of "graduated to Stable, API-baseline pinned."

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(parseT testing.TB, parseDir, parseGolden string)

Check compares dir's current exported API against the golden file, failing the test on any drift. Set UPDATE_API_BASELINE=1 to (re)write the golden after an intentional change.

func Extract

func Extract(parseDir string) ([]string, error)

Extract parses the non-test Go files in dir (ignoring build tags, so the recorded surface is the union across platforms) and returns the exported API as sorted, normalized signature lines.

Types

This section is empty.

Jump to

Keyboard shortcuts

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