diff --git a/Makefile b/Makefile index 84e1da5..557c057 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ linters: - which golangci-lint || (go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2 && echo installed linter) + which golangci-lint || (go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1 && echo installed linter) golangci-lint run --disable-all \ -E "errcheck" \ -E "errname" \ diff --git a/client_test.go b/client_test.go index 8fd29ba..89a889f 100644 --- a/client_test.go +++ b/client_test.go @@ -728,7 +728,7 @@ func TestDo(t *testing.T) { lockErr := make(chan error, 1) go func() { defer wg.Done() - err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error { + err = c.Do(context.Background(), name, func(ctx context.Context, _ *pglock.Lock) error { once := make(chan struct{}, 1) once <- struct{}{} for { @@ -772,7 +772,7 @@ func TestDo(t *testing.T) { if err != nil { t.Fatal("cannot create lock client:", err) } - err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error { + err = c.Do(context.Background(), name, func(context.Context, *pglock.Lock) error { for i := 0; i < 5; i++ { t.Log("i = ", i) time.Sleep(1 * time.Second) @@ -799,7 +799,7 @@ func TestDo(t *testing.T) { } ctx, cancel := context.WithCancel(context.Background()) cancel() - err = c.Do(ctx, name, func(ctx context.Context, l *pglock.Lock) error { + err = c.Do(ctx, name, func(context.Context, *pglock.Lock) error { return nil }) if !errors.Is(err, pglock.ErrNotAcquired) { @@ -822,7 +822,7 @@ func TestDo(t *testing.T) { } ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() - err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error { + err = c.Do(context.Background(), name, func(context.Context, *pglock.Lock) error { for { if err := ctx.Err(); err != nil { return err @@ -852,7 +852,7 @@ func TestDo(t *testing.T) { if _, err := c.Acquire(name); err != nil { t.Fatal("cannot grab lock:", err) } - err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error { + err = c.Do(context.Background(), name, func(context.Context, *pglock.Lock) error { return errors.New("should not have been executed") }, pglock.FailIfLocked()) if !errors.Is(err, pglock.ErrNotAcquired) { @@ -861,7 +861,7 @@ func TestDo(t *testing.T) { if _, err := c.Acquire(name); err != nil { t.Fatal("cannot grab lock:", err) } - err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error { + err = c.Do(context.Background(), name, func(context.Context, *pglock.Lock) error { for i := 0; i < 5; i++ { t.Log("i = ", i) time.Sleep(1 * time.Second) diff --git a/go.mod b/go.mod index d951a27..b4bac8b 100644 --- a/go.mod +++ b/go.mod @@ -19,4 +19,4 @@ require ( golang.org/x/text v0.17.0 // indirect ) -go 1.21 +go 1.23