cmd/vet: adjust vet to use go/types and friends from std repo
- s|"golang.org/x/tools/go/exact"|"go/constant"|
- s|"golang.org/x/tools/go/types"|"go/types"|
- removed import of gcimporter
- import "go/importer" instead
- trivial adjustments to make use of go/importer
- adjusted import paths for whitelist.go
Change-Id: I43488ff44c329cd869c92dcc31193fb31bebfd29
Reviewed-on: https://go-review.googlesource.com/10695
Reviewed-by: Rob Pike <r@golang.org>
diff --git a/src/cmd/vet/print.go b/src/cmd/vet/print.go
index b20d935..d79b096 100644
--- a/src/cmd/vet/print.go
+++ b/src/cmd/vet/print.go
@@ -10,13 +10,12 @@
"bytes"
"flag"
"go/ast"
+ "go/constant"
"go/token"
+ "go/types"
"strconv"
"strings"
"unicode/utf8"
-
- "golang.org/x/tools/go/exact"
- "golang.org/x/tools/go/types"
)
var printfuncs = flag.String("printfuncs", "", "comma-separated list of print function names to check")
@@ -160,11 +159,11 @@
}
return
}
- if lit.Kind() != exact.String {
+ if lit.Kind() != constant.String {
f.Badf(call.Pos(), "constant %v not a string in call to %s", lit, name)
return
}
- format := exact.StringVal(lit)
+ format := constant.StringVal(lit)
firstArg := formatIndex + 1 // Arguments are immediately after format string.
if !strings.Contains(format, "%") {
if len(call.Args) > firstArg {