Navigation Menu

Skip to content
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

cmd/go: install pkg@version with GOFLAGS=-mod=vendor causes error #45811

Open
magodo opened this issue Apr 28, 2021 · 2 comments
Open

cmd/go: install pkg@version with GOFLAGS=-mod=vendor causes error #45811

magodo opened this issue Apr 28, 2021 · 2 comments
Labels
GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@magodo
Copy link

magodo commented Apr 28, 2021

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

$ go version

go version go1.16 linux/amd64

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="amd64"
GOBIN=""
GOCACHE="/home/magodo/.cache/go-build"
GOENV="/home/magodo/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/magodo/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/magodo/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/magodo/github/terraform-provider-azurerm-secondary/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 -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build646611781=/tmp/go-build -gno-record-gcc-switches"

What did you do?

GOFLAGS="-mod=vendor" go install github.com/client9/misspell/cmd/misspell@latest

What did you expect to see?

The binary is installed without issue.

What did you see instead?

go install github.com/client9/misspell/cmd/misspell@latest: cannot query module due to -mod=vendor

@seankhliao seankhliao changed the title go install with GOFLAGS=-mod=vendor causes error cmd/go: install pkg@version with GOFLAGS=-mod=vendor causes error Apr 28, 2021
@seankhliao seankhliao added GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Apr 28, 2021
@bcmills bcmills added this to the Backlog milestone Apr 28, 2021
@bcmills
Copy link
Contributor

bcmills commented Apr 28, 2021

CC @jayconrod @matloob

@tfbirk
Copy link

tfbirk commented Mar 20, 2023

I'm using golang 1.19.7, and the comment from the linked PR here made me realize I could just clear my GOFLAGS to get rid of this: openshift/knative-serving#1180 (comment)

RUN GOFLAGS='' go install github.com/mikefarah/yq/v3@latest

So to anyone else searching that error message, check your go env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants