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
?
go
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
?
Best Answer
go get
will install the package in the first directory listed atGOPATH
(an environment variable which might contain a colon separated list of directories). You can usego get -u
to update existing packages.You can also use
go get -u all
to update all packages in yourGOPATH
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 theGOPATH
environment variable.