From e875f4f930049cec439c7996cd7f66e96c8d4e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=B1=E8=88=9E=E8=80=85?= Date: Fri, 3 Dec 2021 09:30:03 +0800 Subject: [PATCH] fix bug --- common/ParseIP.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/ParseIP.go b/common/ParseIP.go index feb0f51..c838af2 100644 --- a/common/ParseIP.go +++ b/common/ParseIP.go @@ -23,9 +23,6 @@ var ParseIPErr = errors.New(" host parsing error\n" + "192.168.1.1-255") func ParseIP(host string, filename string, nohosts ...string) (hosts []string, err error) { - if host == "" { - return - } hosts = ParseIPs(host) if filename != "" { var filehost []string @@ -57,7 +54,7 @@ func ParseIP(host string, filename string, nohosts ...string) (hosts []string, e } } hosts = RemoveDuplicate(hosts) - if len(hosts) == 0 { + if len(hosts) == 0 && host != "" && filename != "" { err = ParseIPErr } return