I am new to golang and I am trying to get a package but I get a strange error and can't seem to figure out what the problem is?
padlar@padlar:~/workspace-go$ echo $GOPATH
/home/padlar/workspace-go
padlar@padlar:~/workspace-go$ go get golang.org/x/oauth2
padlar@padlar:~/workspace-go$ ls ~/workspace-go/src/golang.org/x/oauth2/
AUTHORS google/ jwt_test.go README.md
CONTRIBUTORS internal/ LICENSE transport.go
example_test.go jws/ oauth2.go transport_test.go
.git/ jwt.go oauth2_test.go .travis.yml
padlar@padlar:~/workspace-go$ ls ~/workspace-go/pkg/linux_amd64/golang.org/x/oauth2
oauth2/ oauth2.a
padlar@padlar:~/workspace-go$ ls ~/workspace-go/pkg/linux_amd64/golang.org/x/oauth2/
internal.a jws.a
padlar@padlar:~/workspace-go$ go get github.com/golang/oauth2
can't load package: package github.com/golang/oauth2: code in directory /home/padlar/workspace-go/src/github.com/golang/oauth2 expects import "golang.org/x/oauth2"
You are using go get
on two different import paths. The new path,
go get golang.org/x/oauth2
and the old path
go get github.com/golang/oauth2
This confuses the Go tool chain. Consistently use the new import path
go get golang.org/x/oauth2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With