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

Some libraries will always have unexpected end of JSON input errors #79

Closed
fitzix opened this issue Jul 10, 2019 · 8 comments · Fixed by #81
Closed

Some libraries will always have unexpected end of JSON input errors #79

fitzix opened this issue Jul 10, 2019 · 8 comments · Fixed by #81
Labels

Comments

@fitzix
Copy link

fitzix commented Jul 10, 2019

Most of the vscode goalng extended dependencies will get this error, such as github.com/mdempsky/gocode, golang.org/x/tools/cmd/guru, golang.org/x/tools/cmd/gopls.

go get -v golang.org/x/tools/cmd/gopls
go: finding golang.org/x/tools/cmd/gopls latest
go: finding golang.org/x/tools/cmd latest
go: finding golang.org latest
go: finding golang.org/x/tools latest
go: finding golang.org/x latest
go get golang.org/x/tools/cmd/gopls: module golang.org/x/tools/cmd: unexpected end of JSON input

@oiooj
Copy link
Member

oiooj commented Jul 10, 2019

@fitzix What's your GOPROXY env ? Which commit version you use if you build by yourself?

@fitzix
Copy link
Author

fitzix commented Jul 10, 2019

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/fitz/Library/Caches/go-build"
GOENV="/Users/fitz/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/fitz/.go"
GOPRIVATE=""
GOPROXY="https://goproxy.io,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6w/2ynsrj4d4fqd7vxrf1gmkq4w0000gn/T/go-build692195248=/tmp/go-build -gno-record-gcc-switches -fno-common"

@oiooj oiooj mentioned this issue Jul 10, 2019
@fitzix
Copy link
Author

fitzix commented Jul 10, 2019

It is weird, remove GOPROXY and use the default GOPROXY="https://proxy.golang.org,direct", no error.

go get -v golang.org/x/tools/cmd/gopls
get "golang.org/x/tools/cmd/gopls": found meta tag get.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at //golang.org/x/tools/cmd/gopls?go-get=1
get "golang.org/x/tools/cmd/gopls": verifying non-authoritative meta tag
go: finding golang.org/x/tools/cmd/gopls latest
go: finding golang.org/x/tools latest

@oiooj
Copy link
Member

oiooj commented Jul 10, 2019

I can not reproduce your issue using goproxy.io , log:

Sosara@MBA:/tmp$ go get -v golang.org/x/tools/cmd/gopls
go: finding golang.org/x/tools/cmd/gopls latest
go: finding golang.org/x latest
go: finding golang.org latest
go: finding golang.org/x/tools/cmd latest
go: finding golang.org/x/tools latest
go: downloading golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468
go: extracting golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468
go: downloading golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: extracting golang.org/x/sync v0.0.0-20190423024810-112230192c58
go: finding golang.org/x/sync v0.0.0-20190423024810-112230192c58

@fitzix
Copy link
Author

fitzix commented Jul 10, 2019

This problem will only appear on 1.13,may be caused by some bugs in 1.13beta1.

@oiooj
Copy link
Member

oiooj commented Jul 10, 2019

Yes, I can reproduce with go1.13beta1

# go version
go version go1.13beta1 linux/amd64

# go get -v golang.org/x/tools/cmd/gopls
go: finding golang.org/x/tools/cmd/gopls latest
go: finding golang.org latest
go: finding golang.org/x latest
go: finding golang.org/x/tools/cmd latest
go: finding golang.org/x/tools latest
go get golang.org/x/tools/cmd/gopls: module golang.org/x/tools/cmd: unexpected end of JSON input

But you can use go get -v golang.org/x/tools.

@oiooj
Copy link
Member

oiooj commented Jul 11, 2019

@fitzix I fixed this issue and deployed online, can you help me to confirm this bug is fixed?

@fitzix
Copy link
Author

fitzix commented Jul 11, 2019

Sure, I tested the dependency of the vscode go plugin, it works fine now, thank u.

@oiooj oiooj closed this as completed in #81 Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants