run golangci-lint and apply suggested fixes

This commit is contained in:
Christian Schwarz
2019-03-22 20:45:27 +01:00
parent afed762774
commit 5b97953bfb
67 changed files with 413 additions and 353 deletions
@@ -106,7 +106,7 @@ func NewInterceptors(logger Logger, clientIdentityKey interface{}) (unary grpc.U
if !ok {
panic("peer.FromContext expected to return a peer in grpc.UnaryServerInterceptor")
}
logger.WithField("peer_addr", fmt.Sprintf("%s", p.Addr)).Debug("peer addr")
logger.WithField("peer_addr", p.Addr.String()).Debug("peer addr")
a, ok := p.AuthInfo.(*authConnAuthType)
if !ok {
panic(fmt.Sprintf("NewInterceptors must be used in combination with grpc.NewTransportCredentials, but got auth type %T", p.AuthInfo))
+3
View File
@@ -88,6 +88,9 @@ func server() {
log := logger.NewStderrDebugLogger()
srv, serve, err := grpchelper.NewServer(authListenerFactory, clientIdentityKey, log)
if err != nil {
onErr(err, "new server")
}
svc := &greeter{"hello "}
pdu.RegisterGreeterServer(srv, svc)
@@ -5,11 +5,10 @@ package pdu
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.