go version)?$ go version 1.12
yes
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"
succeed
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
../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)
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!
Most helpful comment
go mod tidy; go get golang.org/x/tools/gopls@latestshould work