Merge pull request #1012 from Astone-Chou/lint

improve code quality
This commit is contained in:
Asim Aslam
2019-12-03 13:10:04 +00:00
committed by GitHub
20 changed files with 67 additions and 89 deletions

View File

@@ -222,7 +222,9 @@ func (g *grpcServer) handler(srv interface{}, stream grpc.ServerStream) error {
// set the timeout if we have it
if len(to) > 0 {
if n, err := strconv.ParseUint(to, 10, 64); err == nil {
ctx, _ = context.WithTimeout(ctx, time.Duration(n))
var cancel context.CancelFunc
ctx, cancel = context.WithTimeout(ctx, time.Duration(n))
defer cancel()
}
}