0

I'm trying to build go program on remote server from bash script but error (sh: 1: go: not found) returns. Same thing if I try to figure out the version:

ssh user@host "go version"

sh: 1: go: not found

How to fix it? (go on that server exists and works)

Mike Doe
  • 16,349
  • 11
  • 65
  • 88
batrSens
  • 15
  • 5

1 Answers1

1

Use full path to the go binary instead, don't rely on the PATH. Execute whereis go to check where it's located, so it should be sth like:

ssh user@host "/usr/local/go/bin/go version"

More information why did it happen here and here.

Mike Doe
  • 16,349
  • 11
  • 65
  • 88