From 2dc8d565e10c21c42a995055ca0c92f1b92d874d Mon Sep 17 00:00:00 2001 From: Chris Dzombak Date: Mon, 25 Sep 2023 09:33:28 -0400 Subject: [PATCH] avoid logging nil error --- runner.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runner.go b/runner.go index 3cc7d9b..7713d98 100644 --- a/runner.go +++ b/runner.go @@ -167,8 +167,10 @@ func main() { u, err := user.LookupId(strconv.Itoa(*asUID)) if err != nil && u != nil { userHome = u.HomeDir - } else { + } else if err != nil { log.Printf("cannot find homedir for UID %d (%s); HOME will not be changed", *asUID, err) + } else { + log.Printf("cannot find homedir for UID %d; HOME will not be changed.", *asUID) } } }