Problem
examples/ was scoped out for v0.1.0, but pkg.go.dev surfaces godoc Example* functions prominently. With zero examples, the package looks bare on its public-facing doc page.
Proposal
Pick the 5 highest-traffic public APIs and add an Example function for each in a new example_test.go file (in the same anvil package, so they have access to internals if needed but consume only the public API):
ExampleNewAnvilBuilder — full builder chain end-to-end.
ExampleAnvil_MineBlock
ExampleAnvil_SetBalance
ExampleAnvil_Snapshot (paired with Revert).
ExampleAnvil_Impersonate
Each example must:
- Be runnable (
go test ./... exercises them).
- Have an
// Output: comment so godoc shows the result.
- Be short — 10-20 lines max.
Skip: ExampleNewAnvil if it would just duplicate ExampleNewAnvilBuilder.
Acceptance criteria
go doc -all . | grep '^func Example' shows the new examples.
- pkg.go.dev renders them after a tag bump (verify on
v0.2.0).
- Examples compile in CI.
Problem
examples/was scoped out for v0.1.0, but pkg.go.dev surfaces godocExample*functions prominently. With zero examples, the package looks bare on its public-facing doc page.Proposal
Pick the 5 highest-traffic public APIs and add an
Examplefunction for each in a newexample_test.gofile (in the sameanvilpackage, so they have access to internals if needed but consume only the public API):ExampleNewAnvilBuilder— full builder chain end-to-end.ExampleAnvil_MineBlockExampleAnvil_SetBalanceExampleAnvil_Snapshot(paired withRevert).ExampleAnvil_ImpersonateEach example must:
go test ./...exercises them).// Output:comment so godoc shows the result.Skip:
ExampleNewAnvilif it would just duplicateExampleNewAnvilBuilder.Acceptance criteria
go doc -all . | grep '^func Example'shows the new examples.v0.2.0).