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: go test -race -coverpkg=all AST-parser is broken #60403

Closed
xaionaro opened this issue May 24, 2023 · 3 comments
Closed

cmd/go: go test -race -coverpkg=all AST-parser is broken #60403

xaionaro opened this issue May 24, 2023 · 3 comments

Comments

@xaionaro
Copy link
Contributor

xaionaro commented May 24, 2023

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

$ go version
go version go1.20.4 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/xaionaro/.cache/go-build"
GOENV="/home/xaionaro/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/xaionaro/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/xaionaro/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/xaionaro/.gimme/versions/go1.20.4.linux.amd64"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/xaionaro/.gimme/versions/go1.20.4.linux.amd64/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/xaionaro/go/src/github.com/linuxboot/contest/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 -fdebug-prefix-map=/tmp/go-build143176400=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Just run:

cd /tmp
git clone https://github.com/leodido/go-urn
cd go-urn
go test -race -coverpkg=all ./

What did you expect to see?

ok  	github.com/leodido/go-urn	0.049s	coverage: 7.8% of statements in all

What did you see instead?

../../../../pkg/mod/github.com/leodido/go-urn@v1.2.4/urn.go:86:2: syntax error: unexpected var after top level declaration
@xaionaro
Copy link
Contributor Author

The problem is not reproducible in Go1.18.

@seankhliao
Copy link
Member

fixed on tip.

@cristaloleg
Copy link

Fixed in #58370

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants