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
stable
Justin Reichardt 2022-02-23 13:45:43 -06:00
parent 6715716701
commit 01584ea27a
1 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,6 @@ func main() {
tmpdir := "" tmpdir := ""
hostsloc := "" hostsloc := ""
cfgloc := "" cfgloc := ""
i := true
var daemon bool=false var daemon bool=false
var interval int=1440 var interval int=1440
@ -49,9 +48,8 @@ func main() {
sysdetect (&tmpdir, &hostsloc, &cfgloc) sysdetect (&tmpdir, &hostsloc, &cfgloc)
for i == true { for true {
err := error(nil) err := error(nil)
i = daemon
sites, downloads, err := cfgparse(cfgloc) sites, downloads, err := cfgparse(cfgloc)
if (err != nil){ if (err != nil){
log.Print("Failed to parse config file") log.Print("Failed to parse config file")
@ -79,8 +77,10 @@ func main() {
continue continue
} }
log.Print("Finished updating host") log.Print("Finished updating host")
if (i == true){ if (daemon == true){
time.Sleep(time.Duration(interval) * time.Minute) time.Sleep(time.Duration(interval) * time.Minute)
}else{
break
} }
} }
} }