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
+5.9k Golang : How to search a list of records or data structures
+13.5k Golang : Fix image: unknown format error
+31.1k Golang : Convert an image file to []byte
+17.2k Golang : Qt image viewer example
+11.1k Swift : Convert (cast) Float to String
+6.5k Fix sudo yum hang problem with no output or error messages
+14k Golang : How to determine if user agent is a mobile device example
+10.3k Golang : Command line file upload program to server example
+8.8k Golang : does not implement flag.Value (missing Set method)
+6.9k Linux : How to fix Brother HL-1110 printing blank page problem
+9.6k Golang : Bcrypting password