Skip to content

Instantly share code, notes, and snippets.

@drewwells
Created March 26, 2015 16:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewwells/15e5c4e2b69fdcb1e7d8 to your computer and use it in GitHub Desktop.
Save drewwells/15e5c4e2b69fdcb1e7d8 to your computer and use it in GitHub Desktop.
Local godoc server for private packages. You will need to build the search index (periodically) to use search functionality.
?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN
http://www.apple.com/DTDs/PropertyList-1.0.dtd >
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>GOPATH</key>
<string>{YOUR GOPATH}</string>
<key>GOROOT</key>
<string>/usr/local/go</string>
</dict>
<key>Label</key>
<string>org.golang.doc.example</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/go/bin/godoc</string>
<string>-v</string>
<string>-goroot=/usr/local/go</string>
<string>-http=:6060</string>
<string>-index</string>
<string>-index_files=/tmp/godoc_index.db</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
@drewwells
Copy link
Author

To build the search index use:

godoc -goroot=/usr/local/go -index -index_files=/tmp/godoc_index.db -write_index

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment