Skip to content

go get: confusing message: installing executables with 'go get' in module mode is deprecated #48868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andig opened this issue Oct 8, 2021 · 3 comments

Comments

@andig
Copy link
Contributor

andig commented Oct 8, 2021

What version of Go are you using (go version)?

$ go version
go version go1.17.1 darwin/arm64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/andig/Library/Caches/go-build"
GOENV="/Users/andig/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/andig/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/andig/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/homebrew/Cellar/go/1.17.1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/homebrew/Cellar/go/1.17.1/libexec/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.17.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/andig/htdocs/cashterminal/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sv/rs_453y57xj86xsbz3kw1mbc0000gn/T/go-build2392128046=/tmp/go-build -gno-record-gcc-switches -fno-common"
GOROOT/bin/go version: go version go1.17.1 darwin/arm64
GOROOT/bin/go tool compile -V: compile version go1.17.1
uname -v: Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:20 PDT 2021; root:xnu-7195.141.6~3/RELEASE_ARM64_T8101
ProductName:	macOS
ProductVersion:	11.6
BuildVersion:	20G165
lldb --version: lldb-1300.0.32.2
Swift version 5.5-dev

What did you do?

Require a module:

❯ go get github.com/evcc-io/evcc@master

What did you expect to see?

No error

What did you see instead?

Alias tip: gog github.com/evcc-io/evcc@master
go: downloading github.com/evcc-io/evcc v0.0.0-20211008101320-ad0211e9c660
go: downloading github.com/pascaldekloe/name v1.0.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'.
go get: added github.com/evcc-io/evcc v0.0.0-20211008101320-ad0211e9c660
go get: upgraded github.com/magiconair/properties v1.8.4 => v1.8.5
go get: upgraded github.com/pelletier/go-toml v1.8.1 => v1.9.3
go get: upgraded github.com/spf13/afero v1.4.1 => v1.6.0
go get: upgraded github.com/spf13/cobra v1.1.1 => v1.2.1
go get: upgraded github.com/spf13/viper v1.7.1 => v1.8.1
go get: upgraded github.com/thoas/go-funk v0.7.0 => v0.9.0
go get: upgraded golang.org/x/net v0.0.0-20201010224723-4f7140c49acb => v0.0.0-20210805182204-aaa1db679c0d
go get: upgraded golang.org/x/text v0.3.3 => v0.3.6

As modules user this is highly confusing for me as I did not intent to install executables, much less as part of a dependency.
As module author I would wonder what to do to make my consumers not subject to this hint?

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@andig
Copy link
Contributor Author

andig commented Oct 9, 2021

@seankhliao I feel this is the right place. The issue here is that updating a module for go.mod triggers an (invalid) install warning. This happens for modules that provide both packages and binaries apparently.

@seankhliao
Copy link
Member

The fact that it is confusing is why there's a deprecation warning. It also mentions the other commands users should (have) used. See also #43684

@golang golang locked and limited conversation to collaborators Oct 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants