Skip to content

Commit

Permalink
runner: non-zero exit code when a linter produces a panic (golangci#1979
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ldez authored and SeigeC committed Apr 4, 2023
1 parent daeeb8b commit b00b901
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/lint/runner.go
Expand Up @@ -108,10 +108,10 @@ func (r *Runner) runLinterSafe(ctx context.Context, lintCtx *linter.Context,
err = fmt.Errorf("%s: %w", lc.Name(), pe)

// Don't print stacktrace from goroutines twice
lintCtx.Log.Warnf("Panic: %s: %s", pe, pe.Stack())
r.Log.Errorf("Panic: %s: %s", pe, pe.Stack())
} else {
err = fmt.Errorf("panic occurred: %s", panicData)
r.Log.Warnf("Panic stack trace: %s", debug.Stack())
r.Log.Errorf("Panic stack trace: %s", debug.Stack())
}
}
}()
Expand Down

0 comments on commit b00b901

Please sign in to comment.