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

x/tools/go/packages: cannot import bufio in Go 1.18 #50338

Closed
bobg opened this issue Dec 24, 2021 · 2 comments
Closed

x/tools/go/packages: cannot import bufio in Go 1.18 #50338

bobg opened this issue Dec 24, 2021 · 2 comments

Comments

@bobg
Copy link

bobg commented Dec 24, 2021

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

$ go version
go version go1.18beta1 linux/amd64

Does this issue reproduce with the latest release?

Yes (v1.18beta1)

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

go env Output
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/bobg/.cache/go-build"
GOENV="/home/bobg/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/bobg/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/bobg/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/bobg/sdk/go1.18beta1"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/bobg/sdk/go1.18beta1/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18beta1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/bobg/go/src/github.com/bobg/modver/go.mod"
GOWORK=""
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-build2427960209=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I was beginning to update github.com/bobg/modver for Go 1.18.

I was on my go1.18 branch at commit bobg/modver@561c808

I ran go1.18beta1 test -run TestMajor/major/hashsplit .

What did you expect to see?

I expected the test to pass, as it does under Go 1.17.

What did you see instead?

internal error: package "bufio" without types was imported from "hashsplit"

Note, this happens at https://github.com/bobg/modver/blob/561c808eebbd436d00bb9306490e6e5d7235b8fa/compare.go#L188, during the call to packages.Load, which fatals out rather than returning an error.

@bobg bobg changed the title affected/package: bufio affected/package: importing bufio with golang.org/x/tools/go/packages Dec 24, 2021
@bobg bobg changed the title affected/package: importing bufio with golang.org/x/tools/go/packages golang.org/x/tools/go/packages: cannot import bufio in Go 1.18 Dec 24, 2021
@seankhliao
Copy link
Member

did you try updating x/tools?

@seankhliao seankhliao changed the title golang.org/x/tools/go/packages: cannot import bufio in Go 1.18 x/tools/go/packages: cannot import bufio in Go 1.18 Dec 24, 2021
@bobg
Copy link
Author

bobg commented Dec 24, 2021

I have now. That fixed it - thanks (he said, embarrassed).

@bobg bobg closed this as completed Dec 24, 2021
@golang golang locked and limited conversation to collaborators Dec 24, 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