Issue
Installed Go compiler using the VS Code integrated terminal. The compiler works fine due to the fact that the command "go version" typed in the integrated terminal correctly gives the version.
go version go1.21.1 linux/amd64
However, the command is not recognised when I use the normal Bash terminal on my operating system (Ubuntu 20.4).
Command 'go' not found, but can be installed with:
sudo snap install go # version 1.21.1, or
sudo apt install golang-go # version 2:1.13~1ubuntu2
sudo apt install gccgo-go # version 2:1.13~1ubuntu2
I installed Visual Studio Code using the Ubuntu Software store.
How do I fix the VS Code terminal so that software installed in my integrated terminal reflects in the actual OS system?
Solution
It works after I added Add /usr/local/go/bin to the PATH environment variable
export PATH=$PATH:/usr/local/go/bin
Answered By - Worldwide Answer Checked By - Terry (WPSolving Volunteer)