Skip to content

Commit 5aedb90

Browse files
authored
Merge pull request #1562 from johejo/golangci-lint_v1.32
Update golangci-lint to v1.32
2 parents 015c456 + f5a1707 commit 5aedb90

File tree

7 files changed

+9
-15
lines changed

7 files changed

+9
-15
lines changed

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ jobs:
4545
fi
4646
- name: Install golangci
4747
run: |
48-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.31.0
48+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.32.2
4949
- name: Test
5050
run: make

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ linters:
1919
- exhaustive
2020
- nestif
2121
- nlreturn
22+
- exhaustivestruct
23+
- wrapcheck
24+
- errorlint

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ go_import_path: github.com/go-redis/redis
1717

1818
before_install:
1919
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s --
20-
-b $(go env GOPATH)/bin v1.31.0
20+
-b $(go env GOPATH)/bin v1.32.2

internal/proto/scan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func ScanSlice(data []string, slice interface{}) error {
131131
for i, s := range data {
132132
elem := next()
133133
if err := Scan([]byte(s), elem.Addr().Interface()); err != nil {
134-
err = fmt.Errorf("redis: ScanSlice index=%d value=%q failed: %s", i, s, err)
134+
err = fmt.Errorf("redis: ScanSlice index=%d value=%q failed: %w", i, s, err)
135135
return err
136136
}
137137
}

internal/util.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,6 @@ func isLower(s string) bool {
5050
return true
5151
}
5252

53-
func Unwrap(err error) error {
54-
u, ok := err.(interface {
55-
Unwrap() error
56-
})
57-
if !ok {
58-
return nil
59-
}
60-
return u.Unwrap()
61-
}
62-
6353
//------------------------------------------------------------------------------
6454

6555
func WithSpan(ctx context.Context, name string, fn func(context.Context, trace.Span) error) error {

options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ func setupUnixConn(u *url.URL) (*Options, error) {
271271

272272
db, err := strconv.Atoi(dbStr)
273273
if err != nil {
274-
return nil, fmt.Errorf("redis: invalid database number: %s", err)
274+
return nil, fmt.Errorf("redis: invalid database number: %w", err)
275275
}
276276
o.DB = db
277277

redis.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package redis
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"time"
78

@@ -230,7 +231,7 @@ func (c *baseClient) _getConn(ctx context.Context) (*pool.Conn, error) {
230231
})
231232
if err != nil {
232233
c.connPool.Remove(ctx, cn, err)
233-
if err := internal.Unwrap(err); err != nil {
234+
if err := errors.Unwrap(err); err != nil {
234235
return nil, err
235236
}
236237
return nil, err

0 commit comments

Comments
 (0)