1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:04:44 -07:00

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
This commit is contained in:
Rob Pike 2013-06-18 14:02:01 -07:00
parent df787c2073
commit ce82fb0e23

View File

@ -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.