Skip to content

Instantly share code, notes, and snippets.

@dmitshur
Last active January 3, 2016 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitshur/8486205 to your computer and use it in GitHub Desktop.
Save dmitshur/8486205 to your computer and use it in GitHub Desktop.
Patch to make godoc server display unexported symbols and work on commands. This may be useful for packages you're actively developing and want to see private API of. Modified package is "github.com/golang/gddo/doc".
diff --git a/doc/builder.go b/doc/builder.go
index f772f54..c3b2203 100644
--- a/doc/builder.go
+++ b/doc/builder.go
@@ -560,6 +560,7 @@ func newPackage(dir *gosrc.Directory) (*Package, error) {
if pkg.ImportPath == "builtin" {
mode |= doc.AllDecls
}
+ mode = doc.AllDecls | doc.AllMethods
dpkg := doc.New(apkg, pkg.ImportPath, mode)
@@ -572,7 +573,7 @@ func newPackage(dir *gosrc.Directory) (*Package, error) {
pkg.Synopsis = synopsis(pkg.Doc)
pkg.Examples = b.getExamples("")
- pkg.IsCmd = bpkg.IsCommand()
+ pkg.IsCmd = false
pkg.GOOS = ctxt.GOOS
pkg.GOARCH = ctxt.GOARCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment