From a810ae3b7fdc95468ed898e34b5bc35c41a86858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E7=81=BF?= Date: Mon, 3 Jul 2023 11:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=85=B3=E9=97=ADfix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/tools/hosts.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/common/tools/hosts.go b/src/common/tools/hosts.go index 0c61c24..210f71a 100644 --- a/src/common/tools/hosts.go +++ b/src/common/tools/hosts.go @@ -2,7 +2,6 @@ package tools import ( "bufio" - "log" "os" "strings" ) @@ -12,11 +11,7 @@ func HostsToJson() (data map[string][]string, err error) { if err != nil { return nil, err } - defer func() { - if err = f.Close(); err != nil { - log.Fatal(err) - } - }() + defer f.Close() data = make(map[string][]string) // 以这个文件为参数,创建一个 scanner s := bufio.NewScanner(f) -- 2.26.0