Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
acaloiaro committed Jan 26, 2024
1 parent f21eb9c commit 7798b35
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 15 deletions.
10 changes: 0 additions & 10 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ output:
#It's a .golangci.yml config file of this repo: we enable more linters than the default and have more strict settings:

linters-settings:
depguard:
list-type: blacklist
packages:
# logging is allowed only by logutils.Log, logrus
# is allowed to use only in logutils package
- github.com/sirupsen/logrus
packages-with-error-message:
- github.com/sirupsen/logrus: "logging is allowed only by logutils.Log"
dupl:
threshold: 100
funlen:
Expand Down Expand Up @@ -115,7 +107,6 @@ linters:
- contextcheck
- cyclop
- decorder
- depguard
- dogsled
- dupl
- dupword
Expand Down Expand Up @@ -155,7 +146,6 @@ linters:
- maintidx
- makezero
- misspell
- nakedret
- nestif
- nilerr
- nilnil
Expand Down
4 changes: 2 additions & 2 deletions backends/memory/memory_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func Backend(_ context.Context, opts ...neoq.ConfigOption) (backend neoq.Neoq, e
}

// Enqueue queues jobs to be executed asynchronously
func (m *MemBackend) Enqueue(ctx context.Context, job *jobs.Job) (jobID string, err error) {
func (m *MemBackend) Enqueue(_ context.Context, job *jobs.Job) (jobID string, err error) {
var queueChan chan *jobs.Job
var qc any
var ok bool
Expand Down Expand Up @@ -194,7 +194,7 @@ func (m *MemBackend) SetLogger(logger logging.Logger) {
}

// Shutdown halts the worker
func (m *MemBackend) Shutdown(ctx context.Context) {
func (m *MemBackend) Shutdown(_ context.Context) {
for _, f := range m.cancelFuncs {
f()
}
Expand Down
1 change: 1 addition & 0 deletions backends/postgres/postgres_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ func (p *PgBackend) Enqueue(ctx context.Context, job *jobs.Job) (jobID string, e
}
p.logger.Error("error enqueueing job", slog.String("queue", job.Queue), slog.Any("error", err))
err = fmt.Errorf("error enqueuing job: %w", err)
return
}

err = tx.Commit(ctx)
Expand Down
2 changes: 0 additions & 2 deletions backends/postgres/postgres_backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,6 @@ func TestMultipleCronNodes(t *testing.T) {
_, exists := jobsProcessed.LoadOrStore(job.ID, "foo")
if exists {
t.Fatalf("job (%d) has already been processed by another worker!", job.ID)
atomic.AddUint32(&duplicateJobs, 1)
return nil
}
atomic.AddUint32(&jobsCompleted, 1)
return
Expand Down
2 changes: 1 addition & 1 deletion backends/redis/redis_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func (b *RedisBackend) SetLogger(logger logging.Logger) {
}

// Shutdown halts the worker
func (b *RedisBackend) Shutdown(ctx context.Context) {
func (b *RedisBackend) Shutdown(_ context.Context) {
b.client.Close()
b.server.Shutdown()
}
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
go_1_21
gomod2nix.legacyPackages.${system}.gomod2nix
gotools
golangci-lint
go-tools
gopls
pre-commit
Expand Down

0 comments on commit 7798b35

Please sign in to comment.