gopls version

Build gop with x/tools tip 8d1f71aa2

golang.org/x/tools/gopls v0.35.1-0.20250714143223-8d1f71aa2c54

go env

AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='0'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/xieyuschen/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/xieyuschen/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build4029252794=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/xieyuschen/codespace/tools/go.mod'
GOMODCACHE='/home/xieyuschen/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/xieyuschen/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/xieyuschen/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24.2'
GOWORK=''
PKG_CONFIG='pkg-config'

What did you do?

I have a package, along with a cmd package under project root, the module name is github.com/xieyuschen/ibkr-go.

.
├── LICENSE
├── README.md
├── cmd
│   └── generate.go
├── go.mod

I typed maps.

What did you see happen?

Gopls suggests maps import from internal/runtime/maps.

Image

Gopls doesn't report an error for usage var _ maps.Iter as well:

Image

When running go command, go will complain:

package github.com/xieyuschen/ibkr-go/cmd
        cmd/generate.go:7:2: use of internal package internal/runtime/maps not allowed

Currently, gopls only reports an error at the import place:

Image

What did you expect to see?

It's reasonable for gopls to avoid offering package internal/runtime/maps suggestion when typed maps.

I would like to track it and send the fix, if you think it's a reasonable change. Please let me know if I have missed some background here.

Editor and settings

No response

Logs

No response

Comment From: gabyhelp

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)