Explorar el Código

use NewHosts to init hostfile

Matthew R Kasun hace 2 años
padre
commit
a686feb8b4
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      logic/dns.go

+ 4 - 1
logic/dns.go

@@ -14,7 +14,10 @@ import (
 
 // SetDNS - sets the dns on file
 func SetDNS() error {
-	hostfile := txeh.Hosts{}
+	hostfile, err := txeh.NewHosts(&txeh.HostsConfig{})
+	if err != nil {
+		return err
+	}
 	var corefilestring string
 	networks, err := GetNetworks()
 	if err != nil && !database.IsEmptyRecord(err) {