4

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

  • 1
    Welcome to Stackoverflow! Are you sure 'godoc' is in your $PATH? – CFV Jun 24 '20 at 22:55
  • @CFV Thank You I don't think i get what you mean, but to clarify this error is found in Heroku logs – Maher Alhamoui Jun 24 '20 at 23:11
  • Do you know what $PATH is? It is an environment variable used to locate the binaries for installed programs. It contains the paths (hence the name PATH) of the directories in which the terminal is supposed to look for to locate the programs. I think that the binary folder inside your GOPATH is not in your PATH. – CFV Jun 25 '20 at 08:08
  • The env variable `GO_INSTALL_TOOLS_IN_IMAGE` could help you. Try setting it to true. For further information: https://devcenter.heroku.com/articles/go-support – CFV Jun 25 '20 at 08:15
  • @CFV yes sure I know what $gopath what I mean is that gopath is handled by heroku so I guess it's not the matter here (if you have a better idea to check if godoc is already installed and in the right path please let me know) GO_INSTALL_TOOLS_IN_IMAGE = true is already set – Maher Alhamoui Jun 25 '20 at 21:37

1 Answers1

0

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