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
+9.8k Golang : Interfacing with PayPal's IPN(Instant Payment Notification) example
+4.1k Golang : A program that contain another program and executes it during run-time
+12.1k Golang : Skip blank/empty lines in CSV file and trim whitespaces example
+26.3k Golang : Convert integer to binary, octal, hexadecimal and back to integer
+9.7k Golang : Generate 403 Forbidden to protect a page or prevent indexing by search engine
+35.5k Golang : Convert(cast) int64 to string
+7k Golang : Scan files for certain pattern and rename part of the files
+5.3k Golang : Extract XML attribute data with attr field tag example
+10.4k Golang : How to pipe input data to executing child process?
+13.1k Golang : concatenate(combine) strings
+18.9k Golang : Accept input from user with fmt.Scanf skipped white spaces and how to fix it
+6.4k Golang : Of hash table and hash map