-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest
More file actions
17 lines (12 loc) · 730 Bytes
/
Copy pathtest
File metadata and controls
17 lines (12 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Single dependency:
go get github.com/some/package@v1.2.3 # pin to a version
go get github.com/some/package@latest # upgrade to latest
go get github.com/some/package@main # upgrade to a branch
After updating, tidy the module graph:
go mod tidy
Upgrade all dependencies in a module path prefix:
go get $(go list -m -f '{{if not .Indirect}}{{.Path}}{{end}}' all | grep 'some/prefix')
Check what's outdated:
go list -m -u all # lists available upgrades
go list -m -u all 2>/dev/null | grep '\[' # only outdated ones
This repo also has a go.tool.mod for tool dependencies — bump those the same way but with GOWORK=off go get -modfile go.tool.mod github.com/some/tool@latest.