add crawler

This commit is contained in:
juzeon
2024-02-11 20:29:56 -05:00
committed by yuhan6665
parent 9a6a467bcc
commit 5a47c6d530
2 changed files with 53 additions and 4 deletions
+24
View File
@@ -68,3 +68,27 @@ func Iterate(reader io.Reader) <-chan net.IP {
}()
return ipChan
}
func ExistOnlyOne(arr []string) bool {
exist := false
for _, item := range arr {
if item != "" {
if exist {
return false
} else {
exist = true
}
}
}
return exist
}
func RemoveDuplicateStr(strSlice []string) []string {
allKeys := make(map[string]bool)
var list []string
for _, item := range strSlice {
if _, value := allKeys[item]; !value {
allKeys[item] = true
list = append(list, item)
}
}
return list
}