Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix errors reported by Lint CI. #3435

Merged
merged 4 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,5 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60.3
working-directory: ${{ matrix.workdir }}
skip-pkg-cache: true
shenqidebaozi marked this conversation as resolved.
Show resolved Hide resolved
version: v1.61.0
working-directory: ${{ matrix.workdir }}
6 changes: 4 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ linters:
- dogsled
- durationcheck
- errcheck
- exportloopref
# - copyloopvar # need upgrade to Go 1.22
- govet
- staticcheck
- gosimple
- gofmt
- gofumpt
Expand Down Expand Up @@ -49,7 +50,8 @@ linters:

linters-settings:
govet:
check-shadowing: true
enable:
- shadow
whitespace:
multi-func: true
lll:
Expand Down
1 change: 0 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func (a *App) Run() error {
}
}
for _, srv := range a.opts.servers {
srv := srv
shenqidebaozi marked this conversation as resolved.
Show resolved Hide resolved
eg.Go(func() error {
<-ctx.Done() // wait for stop signal
stopCtx, cancel := context.WithTimeout(NewContext(a.opts.ctx, a), a.opts.stopTimeout)
Expand Down
6 changes: 3 additions & 3 deletions transport/grpc/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ func (w *wrappedClientStream) Context() context.Context {
}

func (w *wrappedClientStream) SendMsg(m interface{}) error {
h := func(ctx context.Context, req interface{}) (interface{}, error) {
h := func(_ context.Context, req interface{}) (interface{}, error) {
return req, w.ClientStream.SendMsg(m)
}

Expand All @@ -272,7 +272,7 @@ func (w *wrappedClientStream) SendMsg(m interface{}) error {
}

func (w *wrappedClientStream) RecvMsg(m interface{}) error {
h := func(ctx context.Context, req interface{}) (interface{}, error) {
h := func(_ context.Context, req interface{}) (interface{}, error) {
return req, w.ClientStream.RecvMsg(m)
}

Expand Down Expand Up @@ -305,7 +305,7 @@ func streamClientInterceptor(ms []middleware.Middleware, filters []selector.Node
return nil, err
}

h := func(ctx context.Context, req interface{}) (interface{}, error) {
h := func(_ context.Context, _ interface{}) (interface{}, error) {
return streamer, nil
}

Expand Down
2 changes: 1 addition & 1 deletion transport/grpc/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (s *Server) streamServerInterceptor() grpc.StreamServerInterceptor {
replyHeader: headerCarrier(replyHeader),
})

h := func(ctx context.Context, req interface{}) (interface{}, error) {
h := func(_ context.Context, _ interface{}) (interface{}, error) {
return handler(srv, ss), nil
}

Expand Down
Loading