Skip to content

golang_org import doesn't work in GOPATH mode #23

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

Closed
antong opened this issue Sep 1, 2018 · 3 comments
Closed

golang_org import doesn't work in GOPATH mode #23

antong opened this issue Sep 1, 2018 · 3 comments

Comments

@antong
Copy link

antong commented Sep 1, 2018

The stdlib special cased vendored golang_org/... imports do not work in GOPATH mode on the go1.11 branch. In a module it all works. It also works in mainline with the recent Go 1.11 support (0210a2f).

package main                                  
                                              
import (                                      
        "fmt"                                 
        _ "crypto/x509"                       
)                                             
                                              
func main() {                                 
        fmt.Println("Hello World!")           
}                                             

In a module it works, but in GOPATH it gives:

cannot find package "golang_org/x/crypto/cryptobyte" in any of:
        C:\Users\luser\sw\go\src\golang_org\x\crypto\cryptobyte (from $GOROOT)
        C:\Users\luser\go\src\golang_org\x\crypto\cryptobyte (from $GOPATH)

The stdlib crypto/x509 imports a vendored golang_org/x/crypto/cryptobyte.

@myitcv
Copy link
Owner

myitcv commented Sep 7, 2018

Thanks for the report @antong

This is related to golang/go#26924

I suspect we can fix in GopherJS for now.

myitcv added a commit that referenced this issue Dec 3, 2018
myitcv added a commit that referenced this issue Dec 3, 2018
Ensures that #23 is no longer an issue.
myitcv added a commit that referenced this issue Dec 3, 2018
Ensures that #23 is no longer an issue.
@myitcv
Copy link
Owner

myitcv commented Dec 3, 2018

Closing per #37 which confirms everything is now working (likely post #33) in both GOPATH and modules modes.

@antong - please shout if you are still seeing issues.

@myitcv myitcv closed this as completed Dec 3, 2018
@antong
Copy link
Author

antong commented Dec 7, 2018

THANK YOU! ... is all I shout :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants