What's the difference between `go get -u` and `go get -d`?

I have several questions about go get

  1. what’s the difference between go get -u and go get -d?

$ go get -u github.com/cloudflare/cfssl/cmd/cfssl
go: downloading github.com/jhump/protoreflect v1.10.1
go get: installing executables with 'go get' in module mode is deprecated.
	To adjust and download dependencies of the current module, use 'go get -d'.
	To install using requirements of the current module, use 'go install'.
	To install ignoring the current module, use 'go install' with a version,
	like 'go install example.com/cmd@latest'.
	For more information, see https://golang.org/doc/go-get-install-deprecation
	or run 'go help get' or 'go help install'.
# github.com/zmap/zlint/v3/util
../../../pkg/mod/github.com/zmap/zlint/v3@v3.2.0/util/encodings.go:38:27: cannot use atv.Type (type "github.com/zmap/zcrypto/encoding/asn1".ObjectIdentifier) as type "encoding/asn1".ObjectIdentifier in argument to IsNameAttribute
../../../pkg/mod/github.com/zmap/zlint/v3@v3.2.0/util/oid.go:138:17: cannot use v.Type (type "github.com/zmap/zcrypto/encoding/asn1".ObjectIdentifier) as type "encoding/asn1".ObjectIdentifier in argument to oid.Equal
aircrafts-MacBook-Pro:kubernetes ldl$ go get -d github.com/cloudflare/cfssl/cmd/cfssl
go get: added github.com/cloudflare/cfssl v1.6.1
go get: upgraded github.com/google/uuid v1.1.2 => v1.2.0
go get: upgraded github.com/mohae/deepcopy v0.0.0-20170603005431-491d3605edfb => v0.0.0-20170929034955-c48cc78d4826

there get error: go get: installing executables with 'go get' in module mode is deprecated.
then I use go get -d :

$ go get -d github.com/cloudflare/cfssl/cmd/cfssljson

is it installed success? how to check ?
and
where is the go get -d installed location?

  1. you see go get: installing executables with 'go get' in module mode is deprecated., I want to know which go version it was been deprecated.

Hi @markliao,

go get -d omits the install step, that’s why you do not get the deprecation warning that go get -u trigggers.

Regarding the deprecation of go get for installing binaries, there is a link in the error message you posted that explains the when and why.

TL;DR: use go install for binaries.

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