Add ~/Library/LaunchAgents/org.golang.godoc.plist and modify the GOPATH environment var and godoc path
Then run
launchctl load ~/Library/LaunchAgents/org.golang.godoc.plist
Then navigate to localhost:6060 to see godocs!
| <?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>Label</key> | |
| <string>org.golang.godoc</string> | |
| <key>EnvironmentVariables</key> | |
| <dict> | |
| <!-- set your gopath --> | |
| <key>GOPATH</key> | |
| <string>/Users/ppham/go</string> | |
| </dict> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <!-- ensure this is the absolute path to your godoc install --> | |
| <string>/usr/local/go/bin/godoc</string> | |
| <string>-http=localhost:6060</string> | |
| </array> | |
| <key>RunAtLoad</key> | |
| <true/> | |
| <!-- optional logging --> | |
| <key>StandardErrorPath</key> | |
| <string>/tmp/godocd.err</string> | |
| <key>StandardOutPath</key> | |
| <string>/tmp/godocd.out</string> | |
| </dict> | |
| </plist> |