Does this issue reproduce with the latest release?
no
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\tdl\AppData\Local\go-build
set GOENV=C:\data\moved_software\golang\env
set GOEXE=.exe
set GOFLAGS=-mod=mod
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOOS=windows
set GOPATH=C:\data\tdl\share_data\godata
set GOPRIVATE=
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:\data\moved_software\golang
set GOSUMDB=off
set GOTMPDIR=
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\tdl\AppData\Local\Temp\go-build965195838=/tmp/go-build -gno-record-gcc-switches
What did you do?
i run with go build, that has no errors, but i run with go mod tidy, it is wrong
$ go mod tidy
sso-safety-count/src/common imports
github.com/spf13/viper imports
github.com/spf13/afero imports
io/fs: package io/fs is not in GOROOT (C:\data\moved_software\golang\src\io\fs)
go-project/src/common imports
github.com/spf13/viper imports
github.com/spf13/afero tested by
github.com/spf13/afero.test imports
testing/fstest: package testing/fstest is not in GOROOT (C:\data\moved_software\golang\src\testing\fstest)
i found go build will build with discriminating go version, but go mod tidy not
What did you expect to see?
go mod tidy will run with discriminating go version
What did you see instead?
tdl@DESKTOP-HA3BA9Q MINGW64 go-project(master)
$ go mod tidy
tdl@DESKTOP-HA3BA9Q MINGW64 go-project(master)
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
no
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
i run with
go build
, that has no errors, but i run withgo mod tidy
, it is wrongi found
go build
will build with discriminating go version, butgo mod tidy
notWhat did you expect to see?
go mod tidy
will run with discriminating go versionWhat did you see instead?