Switch to the go/types API in the standard library.

This means that golint now requires Go 1.5 or later.
It also means that vendored packages will now be correctly handled,
assuming you are using Go 1.6 or later.

Fixes #151.
diff --git a/README.md b/README.md
index e5affe4..0b78a52 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,8 @@
 
 ## Installation
 
+Golint requires Go 1.5 or later.
+
     go get -u github.com/golang/lint/golint
 
 ## Usage
diff --git a/lint.go b/lint.go
index 060ea5c..52750b9 100644
--- a/lint.go
+++ b/lint.go
@@ -14,6 +14,7 @@
 	"go/parser"
 	"go/printer"
 	"go/token"
+	"go/types"
 	"regexp"
 	"sort"
 	"strconv"
@@ -21,8 +22,7 @@
 	"unicode"
 	"unicode/utf8"
 
-	"golang.org/x/tools/go/gcimporter"
-	"golang.org/x/tools/go/types"
+	"golang.org/x/tools/go/gcimporter15"
 )
 
 const styleGuideBase = "https://golang.org/wiki/CodeReviewComments"
@@ -236,11 +236,30 @@
 
 var gcImporter = gcimporter.Import
 
+// 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 (p *pkg) typeCheck() error {
 	config := &types.Config{
 		// By setting a no-op error reporter, the type checker does as much work as possible.
-		Error:  func(error) {},
-		Import: gcImporter,
+		Error: func(error) {},
+		Importer: importer{
+			impFn:    gcImporter,
+			packages: make(map[string]*types.Package),
+		},
 	}
 	info := &types.Info{
 		Types:  make(map[ast.Expr]types.TypeAndValue),
@@ -397,7 +416,7 @@
 		s = ts
 	}
 	// Only non-main packages need to keep to this form.
-	if f.f.Name.Name != "main" && !strings.HasPrefix(s, prefix) {
+	if !f.pkg.main && !strings.HasPrefix(s, prefix) {
 		f.errorf(f.f.Doc, 1, link(ref), category("comments"), `package comment should be of the form "%s..."`, prefix)
 	}
 }
diff --git a/lint_test.go b/lint_test.go
index d4539b2..c12370f 100644
--- a/lint_test.go
+++ b/lint_test.go
@@ -14,14 +14,13 @@
 	"go/parser"
 	"go/printer"
 	"go/token"
+	"go/types"
 	"io/ioutil"
 	"path"
 	"regexp"
 	"strconv"
 	"strings"
 	"testing"
-
-	"golang.org/x/tools/go/types"
 )
 
 var lintMatch = flag.String("lint.match", "", "restrict testdata matches to this pattern")
@@ -274,7 +273,8 @@
 			t.Fatalf("Parsing %q: %v", src, err)
 		}
 		// use the package name as package path
-		pkg, err := types.Check(file.Name.Name, fset, []*ast.File{file})
+		config := &types.Config{}
+		pkg, err := config.Check(file.Name.Name, fset, []*ast.File{file}, nil)
 		if err != nil {
 			t.Fatalf("Type checking %q: %v", src, err)
 		}