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

x/vgo: undefined struct on build #24557

Closed
utrescu opened this issue Mar 27, 2018 · 1 comment
Closed

x/vgo: undefined struct on build #24557

utrescu opened this issue Mar 27, 2018 · 1 comment
Milestone

Comments

@utrescu
Copy link

utrescu commented Mar 27, 2018

Please answer these questions before submitting your issue. Thanks!

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

$ go version
go version go1.10 linux/amd64

$ vgo version
go version go1.10 linux/amd64 vgo:2018-02-20.1

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/xavier/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/xavier/.go/"
GORACE=""
GOROOT="/home/xavier/software/go"
GOTMPDIR=""
GOTOOLDIR="/home/xavier/software/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
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-build173078398=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I need the CC env to use gcc:

$ CC=gcc vgo build

Code:

It's a test from dgrijalva/jwt-go package

https://play.golang.org/p/gr8qhww8Z0S

What did you expect to see?

With standard go it builds

$ go build
$ ./jwt-test 
2018/03/27 15:34:40 eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoib3RpYWkxMCIsImFnZSI6MzB9.6juKC9wI5OJd_Gb_HYDqv99VK2d2Rbw2H3V28M_0ays
2018/03/27 15:34:40 map[name:otiai10 age:30] <nil>
2018/03/27 15:34:40 true {otiai10 30 { 0  0  0 }} <nil>

What did you see instead?

$ vgo build
vgo: resolving import "github.com/dgrijalva/jwt-go"
vgo: finding github.com/dgrijalva/jwt-go (latest)
vgo: adding github.com/dgrijalva/jwt-go v1.0.2
# github.com/utrescu/gwt-test
./main.go:12:2: undefined: jwt.StandardClaims
@gopherbot gopherbot added this to the vgo milestone Mar 27, 2018
@rsc
Copy link
Contributor

rsc commented Mar 27, 2018

Sorry for the confusion, but jwt-go does not use semantic import versioning, so by default "latest" has to ignore all the v2+ tagged things, and jwt-go is up to v3.0.x. Presumably StandardClaims is in one of those later versions. You can force the use of the latest commit as if it were still in the v0 world (without semantic import versioning), by using

go get github.com/dgrijalva/jwt-go@06ea1031745

(that's the latest commit, I just looked it up). That should get you going.

@rsc rsc closed this as completed Mar 27, 2018
@golang golang locked and limited conversation to collaborators Mar 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants