-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from d4l3k/remove1.4
pry: remove pre1.5 broken support
- Loading branch information
Showing
2 changed files
with
3 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,10 @@ | ||
// +build !go1.5 | ||
|
||
package pry | ||
|
||
import ( | ||
gcimporter "go/importer" | ||
"go/types" | ||
|
||
gcimporter "golang.org/x/tools/go/gcimporter15" | ||
) | ||
|
||
func getImporter() types.ImporterFrom { | ||
return importer{ | ||
impFn: gcimporter.Import, | ||
packages: make(map[string]*types.Package), | ||
} | ||
} | ||
|
||
// importer implements go/types.Importer. | ||
// It also implements go/types.ImporterFrom, which was new in Go 1.6, | ||
// so vendoring will work. | ||
type importer struct { | ||
impFn func(packages map[string]*types.Package, path, srcDir string) (*types.Package, error) | ||
packages map[string]*types.Package | ||
} | ||
|
||
func (i importer) Import(path string) (*types.Package, error) { | ||
return i.impFn(i.packages, path, "") | ||
} | ||
|
||
func (i importer) ImportFrom(path, srcDir string, mode types.ImportMode) (*types.Package, error) { | ||
return i.impFn(i.packages, path, srcDir) | ||
func getImporter() types.Importer { | ||
return gcimporter.Default() | ||
} |
This file was deleted.
Oops, something went wrong.