add goroutine to check hosts file for updates (#1180)

* add goroutine to check hosts file for updates

* rename parseFile to parseReader, remove extra error check
This commit is contained in:
Pat Moroney
2017-10-31 01:40:47 -06:00
committed by Miek Gieben
parent 87c9f00c83
commit 1d4ac4adbb
6 changed files with 124 additions and 83 deletions

View File

@@ -9,12 +9,11 @@ import (
"reflect"
"strings"
"testing"
"time"
)
func testHostsfile(file string) *Hostsfile {
h := &Hostsfile{expire: time.Now().Add(1 * time.Hour), Origins: []string{"."}}
h.Parse(strings.NewReader(file))
h := &Hostsfile{Origins: []string{"."}}
h.parseReader(strings.NewReader(file))
return h
}