Go: x/tools/cmd/gopls: does not compile at latest

Created on 26 Jul 2019  路  9Comments  路  Source: golang/go

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

$ go version 1.12

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/wdy/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/wdy/pkg:/home/wdy/gitlab/vt/pkg"
GOPROXY="https://goproxy.cn"
GORACE=""
GOROOT="/home/wdy/go"
GOTMPDIR=""
GOTOOLDIR="/home/wdy/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/wdy/gopls/go.mod"
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-build158961015=/tmp/go-build -gno-record-gcc-switches"

What did you do?

What did you expect to see?

succeed

What did you see instead?

go get -u -v golang.org/x/tools/gopls@latest
Fetching https://goproxy.cn/golang.org/x/tools/gopls/@v/list
Fetching https://goproxy.cn/golang.org/x/tools/@v/list
Fetching https://goproxy.cn/golang.org/x/sync/@v/list
Fetching https://goproxy.cn/golang.org/x/net/@v/list
Fetching https://goproxy.cn/golang.org/x/text/@v/list
Fetching https://goproxy.cn/golang.org/x/crypto/@v/list
Fetching https://goproxy.cn/golang.org/x/sys/@v/list
go: finding golang.org/x/sync latest
Fetching https://goproxy.cn/golang.org/x/sync/@latest
go: finding golang.org/x/crypto latest
Fetching https://goproxy.cn/golang.org/x/crypto/@latest
go: finding golang.org/x/net latest
Fetching https://goproxy.cn/golang.org/x/net/@latest
go: finding golang.org/x/sys latest
Fetching https://goproxy.cn/golang.org/x/sys/@latest
go: finding golang.org/x/tools latest
Fetching https://goproxy.cn/golang.org/x/tools/@latest
golang.org/x/tools/gopls

golang.org/x/tools/gopls

../pkg/pkg/mod/golang.org/x/tools/[email protected]/main.go:20:41: not enough arguments in call to cmd.New
have (string, nil)
want (string, string, []string)

FrozenDueToAge gopls

Most helpful comment

go mod tidy; go get golang.org/x/tools/gopls@latest should work

All 9 comments

not enough arguments in call to cmd.New

cc @stamblerre @ianthehat

@kingeasternsun: Does the command work without -u? The @latest tag is a specific version, but adding -u gets the master of the dependencies, which could be incompatible.

@stamblerre same issue, with and without -u

go get golang.org/x/tools/gopls@latest 
# golang.org/x/tools/gopls
../../../../go/pkg/mod/golang.org/x/tools/[email protected]/main.go:20:41: not enough arguments in call to cmd.New
        have (string, nil)
        want (string, string, []string)

if you performed the command in a go module, be sure to delete the old dependencies before rerunning go get golang.org/x/tools/gopls@latest. that worked for me.

@deanveloper is there a single command to do that?

go mod tidy; go get golang.org/x/tools/gopls@latest should work

Thanks @deanveloper! Closing this issue.

@stamblerre @deanveloper
Not working , still the same error!

Was this page helpful?
0 / 5 - 0 ratings