From f8ade8debd8877de4d7717ad48fb48e3203b215d Mon Sep 17 00:00:00 2001 From: Ted Yu Date: Thu, 27 Feb 2020 06:18:05 -0800 Subject: [PATCH] Use named error return for service#StartShim Signed-off-by: Ted Yu --- runtime/v2/runc/v2/service.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/v2/runc/v2/service.go b/runtime/v2/runc/v2/service.go index 06eaaed6e..80fbd7c7f 100644 --- a/runtime/v2/runc/v2/service.go +++ b/runtime/v2/runc/v2/service.go @@ -159,7 +159,7 @@ func readSpec() (*spec, error) { return &s, nil } -func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string) (string, error) { +func (s *service) StartShim(ctx context.Context, id, containerdBinary, containerdAddress, containerdTTRPCAddress string) (_ string, retErr error) { cmd, err := newCommand(ctx, id, containerdBinary, containerdAddress, containerdTTRPCAddress) if err != nil { return "", err @@ -202,7 +202,7 @@ func (s *service) StartShim(ctx context.Context, id, containerdBinary, container return "", err } defer func() { - if err != nil { + if retErr != nil { cmd.Process.Kill() } }()