diff options
author | xengineering <me@xengineering.eu> | 2024-12-01 20:06:53 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-12-01 20:11:30 +0100 |
commit | 9ccb926124e84f46453b863f9cf3b1bdd93836ac (patch) | |
tree | de8ead80c2b540022f1494c4b648d848eaed445a /optional/template_test.go | |
parent | 49ce555973f680db0b8b58a8fdaa060a82016cc2 (diff) | |
download | optional-go-9ccb926124e84f46453b863f9cf3b1bdd93836ac.tar optional-go-9ccb926124e84f46453b863f9cf3b1bdd93836ac.tar.zst optional-go-9ccb926124e84f46453b863f9cf3b1bdd93836ac.zip |
Fix template example name
The naming conventions for test functions are a bit special and
different to the normal naming conventions in Go. They are documented
here [1].
This had the effect that godoc and pkg.go.dev did not display this
example.
Testing with `godoc` locally helped to debug this. Calling `go install
golang.org/x/tools/cmd/godoc@latest` helped with the installation.
[1]: https://go.dev/blog/examples
Diffstat (limited to 'optional/template_test.go')
-rw-r--r-- | optional/template_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/optional/template_test.go b/optional/template_test.go index ab4ce76..83b5821 100644 --- a/optional/template_test.go +++ b/optional/template_test.go @@ -8,7 +8,7 @@ import ( "xengineering.eu/optional-go/optional" ) -func ExampleTemplate() { +func Example_template() { data := struct { Flag optional.Optional[bool] }{ |