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

Support import source file, instead of import only gc-generated file #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ikarishinjieva
Copy link

There are 2 changes:

  1. Support import source file and gc-generated file, instead of import only gc-generated file
    Scenario: If a project proj has two package : proj/a and proj/b, proj/b import proj/a, and proj/a is not “go install”ed.
    When use gcimporter only, gen proj/b will failed with “proj/a is not found for import”.
    It will work with importer.

The code change is to use customized types.Config to check type, instead of types.Check. In the types.Config, Import will use importer to import libs, including source file and gc-generated files

  1. Update predicates.isComparable, to support go.tools for go1.2

Thanks.

…t also go source file.

Scenario: If a project proj has two package : proj/a and proj/b, proj/b import proj/a, and proj/a is not “go install”ed.
When use gcimporter only, gen proj/b will failed with “proj/a is not found for import”.
It will work with importer.
@maddyblue
Copy link
Contributor

There is currently package code.google.com/p/go.tools/importer. There is go.tools/go/importer, but its API is different than here.

@ikarishinjieva
Copy link
Author

@mjibson Thank you for comment.

I think code.google.com/p/go.tools/importer and go.tools/go/importer are very different. code.google.com/p/go.tools/importer is on release-branch-go1.2 and is able to import source and binary, while go.tools/go/importer can only, accroding to its API, "ImportData imports a package from the serialized package data".

I have no idea if they're related or not, and was confused by the fact that they provide different functions under similar namespace...

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