ソースを参照

use NewHosts to init hostfile

Matthew R Kasun 2 年 前
コミット
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) {