Fixed Inappropriate Logical Expression

The length of `finalInterceptors` will always be a
non-zero value. In that case, the comparison will
always return a True value, making the comparison
meaningless.

Signed-off-by: fazledyn-or <ataf@openrefactory.com>
This commit is contained in:
fazledyn-or 2023-12-14 14:42:18 +06:00
parent 8a9e0d936a
commit d317b01244

View File

@ -84,9 +84,7 @@ func startGRPCServer(logger klog.Logger, grpcVerbosity int, interceptors []grpc.
finalInterceptors = append(finalInterceptors, s.interceptor)
}
finalInterceptors = append(finalInterceptors, interceptors...)
if len(finalInterceptors) >= 0 {
opts = append(opts, grpc.ChainUnaryInterceptor(finalInterceptors...))
}
opts = append(opts, grpc.ChainUnaryInterceptor(finalInterceptors...))
s.server = grpc.NewServer(opts...)
for _, service := range services {
service(s.server)