What is the difference between `go get -u -t ./...` and `go get -u -t all`?

What is the difference between go get -u -t ./... and go get -u -t all?

I’m not sure what’s the right way to upgrade all dependencies (Including transitive), in particular, go get -u -t ./... seems to have not upgraded some of my indirect dependencies while go get -u -t all seems to have also added stuff to the go.mod and upgraded other stuff?

I’m quite confused on what’s the difference between the two commands and how the logic for upgrading works or is supposed to work.

Hi and Welcome :slight_smile: ! ./... (most used in the go’s philosophy of avoiding dependencies as much as possible) references all the current package and sub-package dependencies (only the direct ones), while all is useful when you want to update both direct and indirect (not imported in any file or imported from your direct dependency). The latter is common if you want to be sure that all the puzzle pieces work fine if your direct dependencies have some other in turn or if you want to update a dependency temporary not used in order to avoid future problems.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.