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 understandstable
parent
6715716701
commit
01584ea27a
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue