Skip to content

Commit

Permalink
fix(server/drpc,server/grpc): lint errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jochumdev committed Oct 9, 2024
1 parent 19ed81a commit e71c426
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
20 changes: 10 additions & 10 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ runtimes:
- [email protected]
lint:
enabled:
- osv-scanner@1.8.4
- [email protected].239
- trivy@0.54.1
- trufflehog@3.81.10
- osv-scanner@1.9.0
- [email protected].257
- trivy@0.56.1
- trufflehog@3.82.7
- [email protected]
- [email protected].1
- markdownlint@0.41.0
- [email protected].3
- markdownlint@0.42.0
- git-diff-check
- gitleaks@8.18.4
- gitleaks@8.20.1
- [email protected]
- golangci-lint@1.60.3
- golangci-lint@1.61.0
- [email protected]
disabled:
- gokart
- shellcheck
- shfmt
cli:
version: 1.22.4
version: 1.22.6
plugins:
sources:
- id: trunk
ref: v1.6.2
ref: v1.6.3
uri: https://github.com/trunk-io/plugins
4 changes: 2 additions & 2 deletions server/drpc/handle_rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ func (m *Mux) HandleRPC(stream drpc.Stream, rpc string) (err error) {
oErr := orberrors.From(err)

if oErr.Wrapped != nil {
return drpcerr.WithCode(fmt.Errorf("%s: %s", oErr.Message, oErr.Wrapped.Error()), uint64(oErr.Code))
return drpcerr.WithCode(fmt.Errorf("%s: %s", oErr.Message, oErr.Wrapped.Error()), uint64(oErr.Code)) //nolint:gosec
}

return drpcerr.WithCode(errors.New(oErr.Message), uint64(oErr.Code))
return drpcerr.WithCode(errors.New(oErr.Message), uint64(oErr.Code)) //nolint:gosec
case out != nil && !reflect.ValueOf(out).IsNil():
outData, err := anypb.New(out.(proto.Message))
if err != nil {
Expand Down
14 changes: 1 addition & 13 deletions server/grpc/interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,7 @@ func (s *Server) unaryServerInterceptor() grpc.UnaryServerInterceptor {
}

func (s *Server) streamServerInterceptor() grpc.StreamServerInterceptor {
return func(srv any, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
// h := func(srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
// return handler(srv, ss)
// }

// // Add user defined middleware if the route requires.
// if next := s.config.StreamInterceptors.Match(info.FullMethod); len(next) > 0 {
// next = append(next, h)
// h = chainStreamInterceptors(next)
// }

// return h(srv, ss, info, handler)

return func(srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
return handler(srv, ss)
}
}
Expand Down

0 comments on commit e71c426

Please sign in to comment.