Mysterious Otter
Mysterious Otter

Reputation: 4029

Advantage of setting Custom Path?

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:

enter image description here

My question is, why add the new path to our bash profile? We then clone the desired repository there and keep working.

enter image description here

What exactly is the thought process behind this choice?

Upvotes: 0

Views: 37

Answers (2)

Camden Cheek
Camden Cheek

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

Oliver I
Oliver I

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

Related Questions