2
0
Эх сурвалжийг харах

use NewHosts to init hostfile

Matthew R Kasun 2 жил өмнө
parent
commit
a686feb8b4
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  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) {