Skip to content

Commit

Permalink
pglock: upgrade golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ucirello committed Aug 16, 2024
1 parent 6424903 commit 39523d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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" \
Expand Down
12 changes: 6 additions & 6 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)
Expand All @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ require (
golang.org/x/text v0.17.0 // indirect
)

go 1.21
go 1.23

0 comments on commit 39523d3

Please sign in to comment.