Skip to content

Commit

Permalink
Merge pull request #57 from d4l3k/remove1.4
Browse files Browse the repository at this point in the history
pry: remove pre1.5 broken support
  • Loading branch information
d4l3k authored Jun 6, 2018
2 parents 7b19e81 + 19346eb commit 89bce9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 37 deletions.
28 changes: 3 additions & 25 deletions pry/importer.go
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()
}
12 changes: 0 additions & 12 deletions pry/importer15.go

This file was deleted.

0 comments on commit 89bce9e

Please sign in to comment.