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 := ""
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
}
}
}