aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vet/main.go
diff options
context:
space:
mode:
authorDaniel Martí <mvdan@mvdan.cc>2017-09-06 21:59:00 +0200
committerDaniel Martí <mvdan@mvdan.cc>2017-09-07 08:26:27 +0000
commit38ad33088c3bee63e8d53e7aff4d6610d82ca84c (patch)
treedb8011a878cb56c8551f51da8447c0af4f05161a /src/cmd/vet/main.go
parentec0e2edd3b8e92ca003416a4cdbd9b7345d9d38f (diff)
downloadgo-38ad33088c3bee63e8d53e7aff4d6610d82ca84c.tar.gz
go-38ad33088c3bee63e8d53e7aff4d6610d82ca84c.zip
cmd/vet: remove two unused parameters and simplify
The isStar and directory function parameters have been unused ever since they were introduced. Remove them. While at it, apply some other minor simplifications, such as simplifying a HasPrefix if and using an early continue to unindent many lines of code. Change-Id: I8d57353e9ec10cdb59c5388cf6152ce0ec17bdba Reviewed-on: https://go-review.googlesource.com/62030 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Marvin Stenger <marvin.stenger94@gmail.com>
Diffstat (limited to 'src/cmd/vet/main.go')
-rw-r--r--src/cmd/vet/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go
index 34c5297b89..ffe988b9fc 100644
--- a/src/cmd/vet/main.go
+++ b/src/cmd/vet/main.go
@@ -250,7 +250,7 @@ func main() {
}
os.Exit(exitCode)
}
- if doPackage(".", flag.Args(), nil) == nil {
+ if doPackage(flag.Args(), nil) == nil {
warnf("no files checked")
}
os.Exit(exitCode)
@@ -290,12 +290,12 @@ func doPackageDir(directory string) {
names = append(names, pkg.TestGoFiles...) // These are also in the "foo" package.
names = append(names, pkg.SFiles...)
prefixDirectory(directory, names)
- basePkg := doPackage(directory, names, nil)
+ basePkg := doPackage(names, nil)
// Is there also a "foo_test" package? If so, do that one as well.
if len(pkg.XTestGoFiles) > 0 {
names = pkg.XTestGoFiles
prefixDirectory(directory, names)
- doPackage(directory, names, basePkg)
+ doPackage(names, basePkg)
}
}
@@ -312,7 +312,7 @@ type Package struct {
// doPackage analyzes the single package constructed from the named files.
// It returns the parsed Package or nil if none of the files have been checked.
-func doPackage(directory string, names []string, basePkg *Package) *Package {
+func doPackage(names []string, basePkg *Package) *Package {
var files []*File
var astFiles []*ast.File
fs := token.NewFileSet()