MCPcopy
hub / github.com/eolinker/goku_lite / ConvertArray

Function ConvertArray

utils/function.go:34–44  ·  view source on GitHub ↗

ConvertArray 将[]string转为[]int

(arr []string)

Source from the content-addressed store, hash-verified

32
33//ConvertArray 将[]string转为[]int
34func ConvertArray(arr []string) (bool, []int) {
35 result := make([]int, 0)
36 for _, i := range arr {
37 res, err := strconv.Atoi(i)
38 if err != nil {
39 return false, result
40 }
41 result = append(result, res)
42 }
43 return true, result
44}
45
46//ValidateRemoteAddr 判断ip端口是否合法
47func ValidateRemoteAddr(ip string) bool {

Callers

nothing calls this directly

Calls 1

appendFunction · 0.85

Tested by

no test coverage detected