mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-10-21 08:27:02 +00:00
Enable golangci linter gomnd (#3171)
This commit is contained in:
@@ -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{
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user