mirror of
https://github.com/golang/go
synced 2024-11-18 14:54:40 -07:00
go.tools/cmd/vet: set the package name unconditionally
A better fix than the one in CL 10400044 R=gri CC=golang-dev https://golang.org/cl/10376044
This commit is contained in:
parent
ce82fb0e23
commit
86c0ff156c
@ -220,11 +220,7 @@ 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.path = astFiles[0].Name.Name
|
||||
pkg.files = files
|
||||
// Type check the package.
|
||||
err := pkg.check(fs, astFiles)
|
||||
|
Loading…
Reference in New Issue
Block a user