HiveBrain v1.2.0
Get Started
← Back to all entries
patterngoCritical

How does Go update third-party packages?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
howpartyupdatepackagesthirddoes

Problem

Looking how actively golang packages grow and improve I wonder how the problem with package versions is solved?

I see that one way is to store third-party packages under a project folder.

But what if I install it with go get?

Solution

go get will install the package in the first directory listed at GOPATH (an environment variable which might contain a colon separated list of directories). You can use go get -u to update existing packages.

You can also use go get -u all to update all packages in your GOPATH

For larger projects, it might be reasonable to create different GOPATHs for each project, so that updating a library in project A wont cause issues in project B.

Type go help gopath to find out more about the GOPATH environment variable.

Context

Stack Overflow Q#10383498, score: 412

Revisions (0)

No revisions yet.