diff --git a/.travis.yml b/.travis.yml index 36df5842..b09384e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ script: make check_generated test after_success: - test -n "$TRAVIS_TAG" && docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" + - echo "travis go version='$TRAVIS_GO_VERSION'" # needed for the docker pipe services: @@ -18,4 +19,4 @@ deploy: script: curl -sL https://git.io/goreleaser | bash on: tags: true - condition: $TRAVIS_GO_VERSION =~ ^1\.10\.[0-9]+$ \ No newline at end of file + condition: $TRAVIS_GO_VERSION =~ ^1\.10\. diff --git a/pkg/golinters/govet.go b/pkg/golinters/govet.go index f5dbe460..a200b1ba 100644 --- a/pkg/golinters/govet.go +++ b/pkg/golinters/govet.go @@ -76,6 +76,9 @@ func (g Govet) runOnInstalledPackages(ctx context.Context, lintCtx *linter.Conte astFiles = append(astFiles, af.F) fset = af.Fset } + if len(astFiles) == 0 { + continue + } issues, err := govetAPI.Analyze(astFiles, fset, nil, lintCtx.Settings().Govet.CheckShadowing) if err != nil { @@ -216,6 +219,9 @@ func (g Govet) runOnSourcePackages(ctx context.Context, lintCtx *linter.Context) // TODO: check .S asm files: govet can do it if pass dirs var govetIssues []govetAPI.Issue for _, pkg := range lintCtx.Program.InitialPackages() { + if len(pkg.Files) == 0 { + continue + } issues, err := govetAPI.Analyze(pkg.Files, lintCtx.Program.Fset, pkg, lintCtx.Settings().Govet.CheckShadowing) if err != nil {