Closed8

Go News 2021/06/08

TIPS: go mod -u -m allで使ってるモジュールのバージョンアップ情報が取得できる

[]の中が新しいバージョン

$ go list -m -u all
github.com/tenntenn/tennvet
github.com/gcpug/zagane v0.5.2 [v0.5.3]
github.com/google/go-cmp v0.5.4 [v0.5.6]
github.com/gostaticanalysis/analysisutil v0.6.2 [v0.7.1]
github.com/gostaticanalysis/comment v1.4.2
github.com/gostaticanalysis/ctxfield v0.2.2
github.com/gostaticanalysis/dupimport v0.0.0-20190626051117-37d4ab484168
github.com/gostaticanalysis/exclude v0.1.0
github.com/gostaticanalysis/forcetypeassert v0.0.0-20200621232751-01d4955beaa5
github.com/gostaticanalysis/ident v0.0.1
github.com/gostaticanalysis/importgroup v0.0.0-20200207005533-c968b39b7641
github.com/gostaticanalysis/loopdefer v0.1.0
github.com/gostaticanalysis/nilerr v0.1.1
github.com/gostaticanalysis/nofmt v0.0.0-20190308162339-35b38e0c7b48
github.com/gostaticanalysis/notest v0.0.0-20190308173254-8cf418819436
github.com/gostaticanalysis/sqlrows v0.0.0-20200307153552-ea5697937269
github.com/gostaticanalysis/testhelper v0.1.2
github.com/gostaticanalysis/testutil v0.3.1 [v0.4.0]
github.com/gostaticanalysis/typednil v0.1.0 [v0.1.2]
github.com/gostaticanalysis/typeswitch v0.0.0-20200129070600-0c79224605d6
github.com/gostaticanalysis/unitconst v0.1.1 [v0.1.3]
github.com/gostaticanalysis/unused v0.0.5
github.com/gostaticanalysis/wraperrfmt v0.0.0-20190308090456-74aac36802ea
github.com/hashicorp/go-version v1.2.1 [v1.3.0]
github.com/otiai10/copy v1.2.0 [v1.6.0]
github.com/otiai10/curr v1.0.0
github.com/otiai10/mint v1.3.1 [v1.3.2]
github.com/tenntenn/modver v1.0.1
github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3
github.com/yuin/goldmark v1.2.1 [v1.3.7]
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 [v0.0.0-20210513164829-c07d793c2f9a]
golang.org/x/mod v0.4.1 [v0.4.2]
golang.org/x/net v0.0.0-20201021035429-f5854403a974 [v0.0.0-20210525063256-abc453219eb5]
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 [v0.0.0-20210220032951-036812b2e83c]
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c [v0.0.0-20210603125802-9665404d3644]
golang.org/x/text v0.3.3 [v0.3.6]
golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a [v0.1.2]
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1

-jsonつけてjqで絞るともうちょい分かりやすい。

go list -m -u -json all | jq -r "select(.Update != null)|.Update|.Path,.Version"
github.com/gcpug/zagane
v0.5.3
github.com/google/go-cmp
v0.5.6
github.com/gostaticanalysis/analysisutil
v0.7.1
github.com/gostaticanalysis/testutil
v0.4.0
github.com/gostaticanalysis/typednil
v0.1.2
github.com/gostaticanalysis/unitconst
v0.1.3
github.com/hashicorp/go-version
v1.3.0
github.com/otiai10/copy
v1.6.0
github.com/otiai10/mint
v1.3.2
github.com/yuin/goldmark
v1.3.7
golang.org/x/crypto
v0.0.0-20210513164829-c07d793c2f9a
golang.org/x/mod
v0.4.2
golang.org/x/net
v0.0.0-20210525063256-abc453219eb5
golang.org/x/sync
v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys
v0.0.0-20210603125802-9665404d3644
golang.org/x/text
v0.3.6
golang.org/x/tools
v0.1.2

TIPS: go get allでモジュールのバージョンアップができる

$ go get all

go help packagesを見ると

- "all" expands to all packages found in all the GOPATH
trees. For example, 'go list all' lists all the packages on the local
system. When using modules, "all" expands to all packages in
the main module and their dependencies, including dependencies
needed by tests of any of those.

とあり、go help getを見ると

To add a dependency for a package or upgrade it to its latest version:
	go get example.com/pkg

とある。

このスクラップは6ヶ月前にクローズされました
ログインするとコメントできます