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

Fix issue due to go/build.ImportDir change response on not found dir #910

Merged
merged 1 commit into from
Sep 18, 2017

Conversation

mattfarina
Copy link
Member

In go 1.9 there was a change to the way ImportDir, or rather Import
with a local "." package, responded when not found. Previously,
the error was an OS not found error that could be detected by
os.IsNotExist. Now the error is a custom go error using the format:

fmt.Errorf("cannot find package %q in:\n\t%s", path, p.Dir)

This change looks for both cases. For Go 1.9 is checks of it doesn't
exist because there are similar errors in go/build.

For more detail on the Go side of this see golang/go#21923

In go 1.9 there was a change to the way ImportDir, or rather Import
with a local "." package, responded when not found. Previously,
the error was an OS not found error that could be detected by
os.IsNotExist. Now the error is a custom go error using the format:

    fmt.Errorf("cannot find package %q in:\n\t%s", path, p.Dir)

This change looks for both cases. For Go 1.9 is checks of it doesn't
exist because there are similar errors in go/build.

For more detail on the Go side of this see golang/go#21923
@mattfarina
Copy link
Member Author

@sdboyer you might be interested in this error. Or, maybe you already have this one down.

@mattfarina mattfarina merged commit 07a475d into master Sep 18, 2017
@mattfarina mattfarina deleted the fix/go-import-err-change branch September 18, 2017 20:14
@sdboyer
Copy link
Member

sdboyer commented Sep 20, 2017

ah, thanks for the heads-up! we moved away from directly using build.ImportDir and rely directly on go/parser now, so we're set.

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

Successfully merging this pull request may close these issues.

2 participants