Skip to content

Instantly share code, notes, and snippets.

@zchee
Created October 25, 2015 07:20
Show Gist options
  • Save zchee/f31fb19245211c01fc8b to your computer and use it in GitHub Desktop.
Save zchee/f31fb19245211c01fc8b to your computer and use it in GitHub Desktop.
Run godoc at all times
This launchd plist file will run godoc all the time on port 6060.
To have launchd start godoc at login, put godoc.plist in ~/Library/LaunchAgents:
curl -L https://gist.github.com/kr/3de40737f0e2c50b3b3a/raw/godoc.plist |
sed s:YOUR_GODOC_HERE:`which godoc`: |
sed s:YOUR_GOPATH_HERE:$GOPATH: \
>~/Library/LaunchAgents/godoc.plist
Then to load godoc right away:
launchctl load ~/Library/LaunchAgents/godoc.plist
Then you can view the package docs at
http://localhost:6060/pkg/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>godoc</string>
<key>ProgramArguments</key>
<array>
<string>YOUR_GODOC_HERE</string>
<string>-http=:6060</string>
</array>
<key>EnvironmentVariables</key>
<dict>
<key>GOPATH</key>
<string>YOUR_GOPATH_HERE</string>
</dict>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment