All Golang programmer’s are aware of how great “go get” is but until today I had not given much thought to how exactly it did or didn’t do.
Some background; today one of my builds (in Travis CI) suddenly broke in a way that made no sense.
After some quick debugging it became obvious that one of the tools I use for testing had recently pushed an update that was now breaking my tests.
A quick run of the script I use to update my dependencies and I still couldn’t reproduce the issue locally, not until I deleted that dependency and ran “go get” again as travis does.
Turns out, “go get” does not update dependencies, only downloads them.
In order to ensure you always have the latests dependencies you will have to use “go get -u”.
Another helpful tip I recently come across is to use “go get” and “go get -u” without any trailing information. This will scan you source for dependencies and attempt to fulfill them.
(Edit: Removed the incorrect statement regarding the need to delete the dependancies and added reference to update flag)
(Edit: Added reference to using go get without commands to scan code for dependancies)