From 52f3317aa2a937dc0346ebcc1102cbf963aca673 Mon Sep 17 00:00:00 2001 From: Brandur Date: Sat, 9 Aug 2025 11:39:32 -1000 Subject: [PATCH] Upgrade golangci-lint to v2.3.0 I have version v2.3.0 locally, and I'm just noticing that I'm starting to see autocorrections sneak into any changes I make. Here, upgrade so we're consistent across all environments. --- .github/workflows/ci.yaml | 2 +- client.go | 6 +++--- client_test.go | 4 ++-- rivertype/river_type.go | 2 +- worker.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 964368a1..9afd1a18 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -243,7 +243,7 @@ jobs: name: lint runs-on: ubuntu-latest env: - GOLANGCI_LINT_VERSION: v2.2.1 + GOLANGCI_LINT_VERSION: v2.3.0 permissions: contents: read # allow read access to pull request. Use with `only-new-issues` option. diff --git a/client.go b/client.go index 0c68b500..9c78f58a 100644 --- a/client.go +++ b/client.go @@ -559,16 +559,16 @@ type QueueConfig struct { func (c QueueConfig) validate(queueName string, clientFetchCooldown time.Duration, clientFetchPollInterval time.Duration) error { if c.FetchCooldown < 0 { - return fmt.Errorf("FetchCooldown cannot be less than zero") + return errors.New("FetchCooldown cannot be less than zero") } if c.FetchPollInterval < 0 { - return fmt.Errorf("FetchPollInterval cannot be less than zero") + return errors.New("FetchPollInterval cannot be less than zero") } resolvedFetchCooldown := cmp.Or(c.FetchCooldown, clientFetchCooldown) resolvedFetchPollInterval := cmp.Or(c.FetchPollInterval, clientFetchPollInterval) if resolvedFetchPollInterval < resolvedFetchCooldown { - return fmt.Errorf("FetchPollInterval cannot be less than FetchCooldown") + return errors.New("FetchPollInterval cannot be less than FetchCooldown") } if c.MaxWorkers < 1 || c.MaxWorkers > QueueNumWorkersMax { diff --git a/client_test.go b/client_test.go index 5fbc4198..38216bad 100644 --- a/client_test.go +++ b/client_test.go @@ -863,7 +863,7 @@ func Test_Client_Common(t *testing.T) { require.True(t, hookInsertBeginCalled.Load()) }) - t.Run("WithWorkBeginHookOnJobArgs", func(t *testing.T) { //nolint:dupl + t.Run("WithWorkBeginHookOnJobArgs", func(t *testing.T) { t.Parallel() _, bundle := setup(t) @@ -899,7 +899,7 @@ func Test_Client_Common(t *testing.T) { require.True(t, hookWorkBeginCalled.Load()) }) - t.Run("WithWorkEndHookOnJobArgs", func(t *testing.T) { //nolint:dupl + t.Run("WithWorkEndHookOnJobArgs", func(t *testing.T) { t.Parallel() _, bundle := setup(t) diff --git a/rivertype/river_type.go b/rivertype/river_type.go index 79f9852b..a946a460 100644 --- a/rivertype/river_type.go +++ b/rivertype/river_type.go @@ -495,7 +495,7 @@ func UniqueOptsByStateDefault() []JobState { } } -// WorkerMetadata is metadata about workers registerd with a client. +// WorkerMetadata is metadata about workers registered with a client. type WorkerMetadata struct { // JobArgHooks are job args specific hooks returned from a JobArgsWithHooks // implementation. diff --git a/worker.go b/worker.go index 22f83b21..15493157 100644 --- a/worker.go +++ b/worker.go @@ -108,7 +108,7 @@ func AddWorker[T JobArgs](workers *Workers, worker Worker[T]) { // AddWorkerArgs is the same as AddWorker except that it lets args be passed // explicitly rather than being instantiated implicitly. We don't know of any // use for this function beyond exercising some args-related edge cases in tests -// are are difficult/impossible to exercise otherwise, and its use should be +// are difficult/impossible to exercise otherwise, and its use should be // considered internal only. func AddWorkerArgs[T JobArgs](workers *Workers, jobArgs T, worker Worker[T]) { if err := workers.add(jobArgs, &workUnitFactoryWrapper[T]{worker: worker}); err != nil {