2025/01/30
That you can write golang examples that get run using go test:
func ExampleHello() { fmt.Println("hello") // Output: hello }The naming convention to declare examples for the package, a function F, a type T and method M on type T are:
func Example() { ... } func ExampleF() { ... } func ExampleT() { ... } func ExampleT_M() { ... }
I feel like this might be able to be combined with doc comments.