From 01584ea27a31b30aacd70ff6af83d0c80bd1cf73 Mon Sep 17 00:00:00 2001 From: Justin Reichardt Date: Wed, 23 Feb 2022 13:45:43 -0600 Subject: [PATCH] Removed the uneeded i variable in main Was originally used since the for loop doesn't have a dowhile, but breaking when not false made the code simpler to understand --- src/rhosts.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rhosts.go b/src/rhosts.go index 18ae81c..e8f6921 100644 --- a/src/rhosts.go +++ b/src/rhosts.go @@ -36,7 +36,6 @@ func main() { tmpdir := "" hostsloc := "" cfgloc := "" - i := true var daemon bool=false var interval int=1440 @@ -49,9 +48,8 @@ func main() { sysdetect (&tmpdir, &hostsloc, &cfgloc) - for i == true { + for true { err := error(nil) - i = daemon sites, downloads, err := cfgparse(cfgloc) if (err != nil){ log.Print("Failed to parse config file") @@ -79,8 +77,10 @@ func main() { continue } log.Print("Finished updating host") - if (i == true){ + if (daemon == true){ time.Sleep(time.Duration(interval) * time.Minute) + }else{ + break } } }