Put this in the folder ~/Library/LaunchAgents
with a file name like org.golang.doc.example.plist
:
<?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.doc.example</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/go/bin/godoc</string>
<string>-http=:6060</string>
</array>
<key>KeepAlive</key>
<true />
</dict>
</plist>
You may have to create the folder yourself.
The next time you log into your account, godoc
should automatically start on port 6060.
(I have not tested it very well though. Feedback welcome!)