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

Unable to import file with more than 2 import paths #74

Closed
tfeng opened this issue Oct 22, 2017 · 1 comment · Fixed by #75
Closed

Unable to import file with more than 2 import paths #74

tfeng opened this issue Oct 22, 2017 · 1 comment · Fixed by #75

Comments

@tfeng
Copy link

tfeng commented Oct 22, 2017

The code snippet below in parser.go has a bug. It doesn't try to import the file when it exists only on the 3rd import path or later.

accessor = func(name string) (io.ReadCloser, error) {
        var ret error
        for _, path := range paths {
                f, err := acc(filepath.Join(path, name))
                if err != nil && ret == nil {
                        ret = err
                        continue
                }
                return f, nil
        }
        return nil, ret
}
@jhump
Copy link
Owner

jhump commented Oct 22, 2017

Thanks for the fix!

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 a pull request may close this issue.

2 participants