the go mod tidy
adds package dependencies to the go.mod file. How we can update them automatically without manually editing go.mod file, e.g. by removing some entries? For instance, if I use make I want to add a similar command that can update all dependencies of my package/repo and then compile the code with latest version of package dependencies.
Asked
Active
Viewed 4,716 times
2

Valentin
- 1,492
- 3
- 18
- 27
1 Answers
5
In order to update all the dependencies you need to use:
go get -u
And then go mod tidy
.
go get -u
updates all packages and their dependencies, changing the go.mod
.

ezeKG
- 146
- 1
- 6