Code optimization

This commit is contained in:
刘河
2019-03-29 10:41:57 +08:00
parent 4b0aebd6a5
commit cc6d053b6d
32 changed files with 357 additions and 289 deletions

View File

@@ -13,10 +13,8 @@ import (
"net/http"
"os"
"regexp"
"sort"
"strconv"
"strings"
"sync"
)
//Get the corresponding IP address through domain name
@@ -346,12 +344,3 @@ func BytesToNum(b []byte) int {
x, _ := strconv.Atoi(str)
return int(x)
}
func GetMapKeys(m sync.Map) (keys []int) {
m.Range(func(key, value interface{}) bool {
keys = append(keys, key.(int))
return true
})
sort.Ints(keys)
return
}