Enable golangci linter gomnd (#3171)

This commit is contained in:
Robert Kaussow
2024-03-15 18:00:25 +01:00
committed by GitHub
parent 9bbd30fa1e
commit a779eed3df
50 changed files with 262 additions and 176 deletions

View File

@@ -40,7 +40,7 @@ func NewAuthGrpcClient(conn *grpc.ClientConn, agentToken string, agentID int64)
}
func (c *AuthClient) Auth() (string, int64, error) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) //nolint: gomnd
defer cancel()
req := &proto.AuthRequest{

View File

@@ -53,8 +53,8 @@ func (c *client) Close() error {
func (c *client) newBackOff() backoff.BackOff {
b := backoff.NewExponentialBackOff()
b.MaxInterval = 10 * time.Second
b.InitialInterval = 10 * time.Millisecond
b.MaxInterval = 10 * time.Second //nolint: gomnd
b.InitialInterval = 10 * time.Millisecond //nolint: gomnd
return b
}

View File

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