From ce82fb0e23f80d423830d9e2389e141c3ea83d97 Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 18 Jun 2013 14:02:01 -0700 Subject: [PATCH] go.tools/cmd/vet: use directory for pkg.path if path is "." Before: math/big/nat_test.go:688: arg r for printf verb %s of wrong type: ..Word After: math/big/nat_test.go:688: arg r for printf verb %s of wrong type: big.Word R=gri CC=golang-dev https://golang.org/cl/10400044 --- cmd/vet/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/vet/main.go b/cmd/vet/main.go index c8b6fe70..564e2e2a 100644 --- a/cmd/vet/main.go +++ b/cmd/vet/main.go @@ -220,6 +220,10 @@ func doPackage(directory string, names []string) { files = append(files, &File{fset: fs, content: data, name: name, file: parsedFile}) } pkg := new(Package) + if directory == "." { + // Special case: Use the base name so we don't see "." as the package name in messages. + directory = filepath.Base(filepath.Dir(names[0])) + } pkg.path = directory pkg.files = files // Type check the package.