internal: reformat long lines in internal/csi-common package to 120 chars

We have many declarations and invocations..etc with long lines which are
very difficult to follow while doing code reading. This address the issues
in 'internal/csi-common' package to restrict the line length to 120 chars.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2021-06-25 16:50:31 +05:30
committed by mergify[bot]
parent f526c4a5e8
commit a3b83fe8a7
5 changed files with 71 additions and 22 deletions

View File

@ -150,7 +150,11 @@ func getReqID(req interface{}) string {
var id uint64
func contextIDInjector(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
func contextIDInjector(
ctx context.Context,
req interface{},
info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler) (resp interface{}, err error) {
atomic.AddUint64(&id, 1)
ctx = context.WithValue(ctx, util.CtxKey, id)
if reqID := getReqID(req); reqID != "" {
@ -159,7 +163,11 @@ func contextIDInjector(ctx context.Context, req interface{}, info *grpc.UnarySer
return handler(ctx, req)
}
func logGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
func logGRPC(
ctx context.Context,
req interface{},
info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler) (interface{}, error) {
util.ExtendedLog(ctx, "GRPC call: %s", info.FullMethod)
if isReplicationRequest(req) {
util.TraceLog(ctx, "GRPC request: %s", rp.StripReplicationSecrets(req))
@ -176,7 +184,11 @@ func logGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, h
return resp, err
}
func panicHandler(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) {
func panicHandler(
ctx context.Context,
req interface{},
info *grpc.UnaryServerInfo,
handler grpc.UnaryHandler) (resp interface{}, err error) {
defer func() {
if r := recover(); r != nil {
klog.Errorf("panic occurred: %v", r)