« Back to Index

Go: godoc example code generation

View original Gist on GitHub

Tags: #go

godoc example code generation.md

Add a file named in a specific format (e.g. example_<whatever>_test.go) and the file has to include a function that has the format Example<Type>_<Method> so the godoc command knows to attach the file contents to the given type and specifically the specified method.