Search code examples
goherokugodoc

how to serve godoc command on Heroku


I am trying to serve godoc -http=:[port] on Heroku server

I get the following error in Heroku logs

bash: godoc: command not found

my Procfile looks like:

web: godoc -http=:$PORT

I tried to install godoc by adding the following line to the Procfile

release: go get -u golang.org/x/tools/cmd/godoc

note: I'm using Go modules


Solution

  • as I'm using go modules I added the following line to my go.mod file to install godoc tool

    // +heroku install golang.org/x/tools/cmd/godoc