This commit is contained in:
影舞者 2021-12-03 09:30:03 +08:00
parent 6807508b69
commit e875f4f930
1 changed files with 1 additions and 4 deletions

View File

@ -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