aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/golang/lint/golint
diff options
context:
space:
mode:
authorJoseph Richey <joerichey94@gmail.com>2018-02-11 20:39:12 -0800
committerJoseph Richey <joerichey94@gmail.com>2018-02-11 20:39:12 -0800
commit734f50d8fcb4df4cf611e774123b835f9fc5666b (patch)
tree3afaaab4739f60b218bdc1308d9fb4870bd53add /vendor/github.com/golang/lint/golint
parent23b8c7b4eab0375b3d59cf4b2a1f3d7356515f95 (diff)
golint: Use fork that respects vendor directory
Ideally, we would just use "golint ./..." to check all our our source files for lint error. However, this does not work because it will include all packages in the vendor directory. The pull request at: https://github.com/golang/lint/pull/325 fixes this issue, so we will use it until the PR has been merged.
Diffstat (limited to 'vendor/github.com/golang/lint/golint')
-rw-r--r--vendor/github.com/golang/lint/golint/golint.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/github.com/golang/lint/golint/golint.go b/vendor/github.com/golang/lint/golint/golint.go
index d8360ad..0088274 100644
--- a/vendor/github.com/golang/lint/golint/golint.go
+++ b/vendor/github.com/golang/lint/golint/golint.go
@@ -48,9 +48,12 @@ func main() {
var dirsRun, filesRun, pkgsRun int
var args []string
for _, arg := range flag.Args() {
- if strings.HasSuffix(arg, "/...") && isDir(arg[:len(arg)-len("/...")]) {
+ if trimmedArg := strings.TrimSuffix(arg, "/..."); trimmedArg != arg && isDir(trimmedArg) {
dirsRun = 1
for _, dirname := range allPackagesInFS(arg) {
+ if strings.Contains(dirname[len(trimmedArg):], "/vendor/") {
+ continue
+ }
args = append(args, dirname)
}
} else if isDir(arg) {