A hacky way to update problematic Go modules

The only options for updating modules that I’m aware so far are a) go get -u all, and b) specific modules, i.e. go get -u domain.com/module[@v1.2.3]. For problematic ones, my only option is b), which is a bit time consuming. There must be some other way out there that I’m not aware of but at the moment, I use this simple command:

$ cat go.mod | grep -i 'github' | grep -i -v 'indirect' | awk '{print $1}' > update; \
  while read -r v; do go get -u $v; done < update; rm update
If you have any questions or feedback, please reach out @flowerinthenyt.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.