I have installed Go1.14.3 on my remote server which is on a private network. When I remote SSH my VS Code to that server to work on my Go Project located at ~/BBS/r1rm/tools/DSMigrateWeb, I can see Go1.14.3 in the VS Code taskbar. Even when I run go command from "VS Code terminal", it executes and shows the desired output.
jaydev1642@linuxjaydev:~/BBS/r1rm/tools/DSMigrateWeb$ go
Go is a tool for managing Go source code.
Then when I migrate to a different directory in "VS Code terminal" itself and run the go command, then too it works fine but do the same on command line for any directory and I get the error as "Command 'go' not found".
jaydev1642@linuxjaydev:~/BBS/r1rm/tools/DSMigrateWeb$ go
Command 'go' not found, but can be installed with:
sudo snap install go # version 1.20.6, or sudo apt install golang-go # version 2:1.13~1ubuntu2 sudo apt install gccgo-go # version 2:1.13~1ubuntu2
See 'snap info go' for additional versions.
Here is my .profile file containing GOROOT and PATH variables:
export GOROOT=/usr/local/go
export GOPATH=usr/local/go/bin:/home/jaydev1642/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin: /bin:/usr/games:/usr/local/games
I am not sure why I am facing this issue where Go exists if I try to access it from VS Code Terminal but doesn't when I do from command line. I also restarted the server just in case that might help but it doesn't.