anz-bank / pkg

Common ANZ Go packages
https://pkg.go.dev/github.com/anz-bank/pkg
Apache License 2.0
1 stars 9 forks source link

Make log examples proper godoc examples #47

Open camscale opened 4 years ago

camscale commented 4 years ago

The directory log/_examples contains a main program that uses many (all?) of the features of the log package, and includes a lot of code comments. Those code comments are more detailed/verbose than any of the godocs from what I can see. Additionally, godocs support testable examples that appear in the docs and can be run directly from the docs - see https://blog.golang.org/examples for details.

Rework the examples in log/_examples to be godoc examples.

When done, remove the target from the Makefile that builds the examples, as go test will then build and run the examples.

This will also help by making many smaller targeted examples, rather than one or two big ones that does a bit of everything but does not make a lot of sense together.