安装Appengine SDK之后,Golang未定义google.JWTAccessTokenSourceFromJSON

I installed the Go app engine packages this evening. This seems to have broken my whole Go installation.

Each time I attempt to run any go command, it fails with:

../../../google.golang.org/grpc/credentials/oauth/oauth.go:85: undefined: google.JWTAccessTokenSourceFromJSON

Erm...

I tried nuking the google.golang.org directory without success. When I run go get -x ./... I get the following:

WORK=/var/folders/94/4lkprvq57vj4svwmt_kz5h6m0000gn/T/go-build842729114
mkdir -p $WORK/google.golang.org/grpc/credentials/oauth/_obj/
mkdir -p $WORK/google.golang.org/grpc/credentials/
cd /Users/simon/Documents/Code/golang/src/google.golang.org/grpc/credentials/oauth
/usr/local/Cellar/go/1.6.2/libexec/pkg/tool/darwin_amd64/compile -o $WORK/google.golang.org/grpc/credentials/oauth.a -trimpath $WORK -p google.golang.org/grpc/credentials/oauth -complete -buildid 8d03dba436005dd3d1e75147bde330259f288075 -D _/Users/simon/Documents/Code/golang/src/google.golang.org/grpc/credentials/oauth -I $WORK -I /Users/simon/Documents/Code/golang/pkg/darwin_amd64 -pack ./oauth.go
# google.golang.org/grpc/credentials/oauth
../../../google.golang.org/grpc/credentials/oauth/oauth.go:85: undefined: google.JWTAccessTokenSourceFromJSON

Help needed fixing before all sanity gone.

I ran into this problem as well. I think the go get functionality pulled an outdated repo when updating the Google app engine packages.

This worked for me:

cd $GOPATH/src/golang.org/x/oauth2/google
git fetch 
git pull

Turns out I was 66 commits behind master; this fixed it for me. Hope it works for you.