Skip to content

Commit a3df28c

Browse files
authored
pglock: upgrade golangci-lint (#110)
1 parent 6424903 commit a3df28c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

.github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions/cache@v4
4040
with:
4141
path: ~/go/bin/golangci-lint
42-
key: ${{ runner.os }}-golangci-lint-v1.54.2
42+
key: ${{ runner.os }}-${{ matrix.go-version }}-golangci-lint-v1.60.1
4343

4444
- name: Test
4545
run: |

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
linters:
2-
which golangci-lint || (go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2 && echo installed linter)
2+
which golangci-lint || (go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.1 && echo installed linter)
33
golangci-lint run --disable-all \
44
-E "errcheck" \
55
-E "errname" \

client_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ func TestDo(t *testing.T) {
728728
lockErr := make(chan error, 1)
729729
go func() {
730730
defer wg.Done()
731-
err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error {
731+
err = c.Do(context.Background(), name, func(ctx context.Context, _ *pglock.Lock) error {
732732
once := make(chan struct{}, 1)
733733
once <- struct{}{}
734734
for {
@@ -772,7 +772,7 @@ func TestDo(t *testing.T) {
772772
if err != nil {
773773
t.Fatal("cannot create lock client:", err)
774774
}
775-
err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error {
775+
err = c.Do(context.Background(), name, func(context.Context, *pglock.Lock) error {
776776
for i := 0; i < 5; i++ {
777777
t.Log("i = ", i)
778778
time.Sleep(1 * time.Second)
@@ -799,7 +799,7 @@ func TestDo(t *testing.T) {
799799
}
800800
ctx, cancel := context.WithCancel(context.Background())
801801
cancel()
802-
err = c.Do(ctx, name, func(ctx context.Context, l *pglock.Lock) error {
802+
err = c.Do(ctx, name, func(context.Context, *pglock.Lock) error {
803803
return nil
804804
})
805805
if !errors.Is(err, pglock.ErrNotAcquired) {
@@ -822,7 +822,7 @@ func TestDo(t *testing.T) {
822822
}
823823
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
824824
defer cancel()
825-
err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error {
825+
err = c.Do(context.Background(), name, func(ctx context.Context, _ *pglock.Lock) error {
826826
for {
827827
if err := ctx.Err(); err != nil {
828828
return err
@@ -852,7 +852,7 @@ func TestDo(t *testing.T) {
852852
if _, err := c.Acquire(name); err != nil {
853853
t.Fatal("cannot grab lock:", err)
854854
}
855-
err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error {
855+
err = c.Do(context.Background(), name, func(context.Context, *pglock.Lock) error {
856856
return errors.New("should not have been executed")
857857
}, pglock.FailIfLocked())
858858
if !errors.Is(err, pglock.ErrNotAcquired) {
@@ -861,7 +861,7 @@ func TestDo(t *testing.T) {
861861
if _, err := c.Acquire(name); err != nil {
862862
t.Fatal("cannot grab lock:", err)
863863
}
864-
err = c.Do(context.Background(), name, func(ctx context.Context, l *pglock.Lock) error {
864+
err = c.Do(context.Background(), name, func(context.Context, *pglock.Lock) error {
865865
for i := 0; i < 5; i++ {
866866
t.Log("i = ", i)
867867
time.Sleep(1 * time.Second)

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ require (
1919
golang.org/x/text v0.17.0 // indirect
2020
)
2121

22-
go 1.21
22+
go 1.22

0 commit comments

Comments
 (0)