From 8699596dcef52dac1c7a1545b034db93d0b0e5c6 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 29 Sep 2020 18:38:31 -0700 Subject: [PATCH] libct/(*setnsProcess).Start: use retErr It is not a good practice to have the name `err` for the error returned by a function. Switch to `retErr`. Signed-off-by: Kir Kolyshkin --- libcontainer/process_linux.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcontainer/process_linux.go b/libcontainer/process_linux.go index 2365d4e0f..81004046e 100644 --- a/libcontainer/process_linux.go +++ b/libcontainer/process_linux.go @@ -86,9 +86,9 @@ func (p *setnsProcess) signal(sig os.Signal) error { return unix.Kill(p.pid(), s) } -func (p *setnsProcess) start() (err error) { +func (p *setnsProcess) start() (retErr error) { defer p.messageSockPair.parent.Close() - err = p.cmd.Start() + err := p.cmd.Start() // close the write-side of the pipes (controlled by child) p.messageSockPair.child.Close() p.logFilePair.child.Close() @@ -100,7 +100,7 @@ func (p *setnsProcess) start() (err error) { return newSystemErrorWithCause(err, "copying bootstrap data to pipe") } } - if err = p.execSetns(); err != nil { + if err := p.execSetns(); err != nil { return newSystemErrorWithCause(err, "executing setns process") } if len(p.cgroupPaths) > 0 {