This commit is contained in:
shadow1ng
2020-11-15 22:17:57 +08:00
parent 38fc6dd0c3
commit cdbd1aebc2
10 changed files with 101 additions and 19 deletions
+10 -2
View File
@@ -74,7 +74,7 @@ func Readfile(filename string)([]string,error){
file, err := os.Open(filename)
if err!=nil{
fmt.Println("Open %s error, %v", filename,err)
return nil,err
os.Exit(0)
}
defer file.Close()
var content []string
@@ -92,7 +92,7 @@ func Readfile(filename string)([]string,error){
func ParseInput(Info *HostInfo){
if Info.Host==""{
if Info.Host=="" && Info.HostFile ==""{
fmt.Println("Host is none")
flag.Usage()
os.Exit(0)
@@ -123,4 +123,12 @@ func ParseScantype(Info *HostInfo){
PORTList[name] = ScanPort
}
}
}
func CheckErr(text string,err error){
if err!=nil{
fmt.Println(text,err.Error())
os.Exit(0)
}
}