Golang : All update packages with go get command
Problem :
Some of the third party packages that your Golang application use have now been superseded by better version. How to instruct Golang to download and update all packages. Much like sudo yum update
or sudo apt-get upgrade
in Linux.
Solution :
The command go get <package_name>
is to download and install packages and dependencies, therefore the way to update all Golang packages found under $GOPATH
should be similar.
Use the command go get -u all
to update all the packages.
At the moment of writing, Google is shutting down code.google.com. You will see a bunch of warning messages indicating that packages with import path of code.google.com will stop working. After the update, I was able to run and compile my existing codes. So, it should be ok.
If you encounter problem after running go get -u all
, perhaps you might want to download the latest Golang version and use go get <package_name>
to download the latest packages that you need individually.
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+5k Golang : Extract unicode string from another unicode string example
+7k Prevent Write failed: Broken pipe problem during ssh session with screen command
+18.1k Golang : Count JSON objects and convert to slice/array
+9.5k Golang : Bubble sort example
+21.6k Golang : Strings to lowercase and uppercase example
+4.4k Javascript : How to loop over and parse JSON data?
+8.4k Golang : How to protect your source code from client, hosting company or hacker?
+22.7k Golang : How to print rune, unicode, utf-8 and non-ASCII CJK(Chinese/Japanese/Korean) characters?
+14.8k Golang : convert string or integer to big.Int type
+29.8k Golang : Example for ECDSA(Elliptic Curve Digital Signature Algorithm) package functions
+25.8k PHP : Count number of JSON items/objects
+7.7k Golang : Write multiple lines or divide string into multiple lines