Enable gocritic and don't ignore globally (#3159)

Use `nolint` directives instead.

From #2960
This commit is contained in:
qwerty287
2024-01-10 15:34:44 +01:00
committed by GitHub
parent aef3f8f3ef
commit 12c40eb957
34 changed files with 170 additions and 161 deletions

View File

@@ -160,13 +160,14 @@ func (r *Runner) Run(runnerCtx context.Context) error {
state.ExitCode = 137
} else if err != nil {
pExitError := &pipeline.ExitError{}
if errors.As(err, &pExitError) {
switch {
case errors.As(err, &pExitError):
state.ExitCode = pExitError.Code
} else if errors.Is(err, pipeline.ErrCancel) {
case errors.Is(err, pipeline.ErrCancel):
state.Error = ""
state.ExitCode = 137
canceled.SetTo(true)
} else {
default:
state.ExitCode = 1
state.Error = err.Error()
}