Reputation: 4029
Right I am working through the Scalable Microservices with Kubernetes MOOC from Udacity. At step 5 during the first lesson we're instructed to update the Google Cloud container's version of Go and change the PATH variable:
My question is, why add the new path to our bash profile? We then clone the desired repository there and keep working.
What exactly is the thought process behind this choice?
Upvotes: 0
Views: 37
Reputation: 65
The GOPATH tells the go
executable where to look for go projects and commands as well as to resolve import statements. That way you don't have to manually specify the path of all the resources required to run a go program, and you can customize the installation location of go packages.
Upvotes: 1
Reputation: 456
GOPATH is an environmental variable used by Go to source files: https://github.com/golang/go/wiki/GOPATH
Because you installed a newer version of Go, you want to make sure your GOPATH is updated to where the newer version of Go is installed.
Upvotes: 1