Skip to content
This repository has been archived by the owner on May 9, 2021. It is now read-only.

Commit

Permalink
Fix command panic with a short arg
Browse files Browse the repository at this point in the history
More info: #325 (comment)
  • Loading branch information
lukyth committed Jan 23, 2018
1 parent ab1f5ee commit 0dcd199
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions golint/golint.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ func main() {
// checks are run. It is no valid to mix target types.
var dirsRun, filesRun, pkgsRun int
var args []string
for _, arg := range flag.Args() {
basePath := arg[:len(arg)-len("/...")]
if strings.HasSuffix(arg, "/...") && isDir(basePath) {
for _, arg := range flag.Args() {
if trimmedArg := strings.TrimSuffix(arg, "/..."); trimmedArg != arg && isDir(trimmedArg) {
dirsRun = 1
for _, dirname := range allPackagesInFS(arg) {
if strings.Contains(dirname[len(basePath):], "/vendor/") {
if strings.Contains(dirname[len(trimmedArg):], "/vendor/") {
continue
}
args = append(args, dirname)
Expand Down

0 comments on commit 0dcd199

Please sign in to comment.