We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
According to my understanding of these docs: https://go.dev/doc/go1.21#tools https://go.dev/doc/toolchain#version https://go.dev/ref/mod#go-mod-file-go
before go 1.21 it was not allowed to specify the patch version in the go.mod. so the code in fix cmd:
go.mod
go/src/cmd/fix/main.go
Lines 78 to 79 in 905b58b
1.21.0
go 1.21rc1
go version
$ go version go version go1.21.0 linux/amd64
Yes
go env
$ go env GO111MODULE='' GOARCH='amd64' GOBIN='' GOCACHE='/home/alex/.cache/go-build' GOENV='/home/alex/.config/go/env' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='amd64' GOHOSTOS='linux' GOINSECURE='' GOMODCACHE='/home/alex/go/pkg/mod' GONOPROXY='' GONOSUMDB='' GOOS='linux' GOPATH='/home/alex/go' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOROOT='/usr/lib/go' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOTOOLDIR='/usr/lib/go/pkg/tool/linux_amd64' GOVCS='' GOVERSION='go1.21.0' GCCGO='gccgo' GOAMD64='v1' AR='ar' CC='gcc' CXX='g++' CGO_ENABLED='1' GOMOD='/home/alex/code/reproducer/go.mod' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config' GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build2636372290=/tmp/go-build -gno-record-gcc-switches'
$ mkdir reproducer $ cd reproducer/ $ go mod init reproducer $ cat go.mod module reproducer go 1.21.0 $ cat << EOF > main.go //go:build OMIT // +build OMIT package main import "fmt" func main() { fmt.Println("Hello, World!") } EOF $ go fix -tags OMIT . invalid -go=go1.21.0 exit status 2
Expected go fix to remove the deprecated build tag.
Error about invalid version.
The text was updated successfully, but these errors were encountered:
cc @bcmills @matloob @rsc @ianlancetaylor
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
According to my understanding of these docs:
https://go.dev/doc/go1.21#tools
https://go.dev/doc/toolchain#version
https://go.dev/ref/mod#go-mod-file-go
before go 1.21 it was not allowed to specify the patch version in the
go.mod
.so the code in fix cmd:
go/src/cmd/fix/main.go
Lines 78 to 79 in 905b58b
does not handle string
1.21.0
.Existing code also won't work with
go 1.21rc1
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
Expected go fix to remove the deprecated build tag.
What did you see instead?
Error about invalid version.
The text was updated successfully, but these errors were encountered: