gogodoc

Viewing Example functions with `go doc` command?


If I view a package's documentation via the web at https://pkg.go.dev, the page includes Example test functions. The output of go doc -u -all for a package does not. Is it possible to have such information included?


Solution

  • It is not possible to display examples using the go doc command.

    The command implementation ignores examples.