From 986988a39480cb930202e3bd0bbdd477457d80b9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 28 Dec 2023 11:07:15 +0100 Subject: [PATCH] testutil/daemon: Daemon.StopWithError: rename output-var to prevent shadowing Signed-off-by: Sebastiaan van Stijn --- testutil/daemon/daemon.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testutil/daemon/daemon.go b/testutil/daemon/daemon.go index 6c27c23022..e6d52f0d94 100644 --- a/testutil/daemon/daemon.go +++ b/testutil/daemon/daemon.go @@ -699,13 +699,13 @@ func (d *Daemon) Stop(t testing.TB) { // If it timeouts, a SIGKILL is sent. // Stop will not delete the daemon directory. If a purged daemon is needed, // instantiate a new one with NewDaemon. -func (d *Daemon) StopWithError() (err error) { +func (d *Daemon) StopWithError() (retErr error) { if d.cmd == nil || d.Wait == nil { return errDaemonNotStarted } defer func() { - if err != nil { - d.log.Logf("[%s] error while stopping daemon: %v", d.id, err) + if retErr != nil { + d.log.Logf("[%s] error while stopping daemon: %v", d.id, retErr) } else { d.log.Logf("[%s] daemon stopped", d.id) if d.pidFile != "" {