mihomo/config/utils.go

21 lines
308 B
Go
Raw Normal View History

package config
2018-06-10 22:50:03 +08:00
import (
2018-08-12 02:23:46 +08:00
"fmt"
2018-06-10 22:50:03 +08:00
"strings"
)
func trimArr(arr []string) (r []string) {
for _, e := range arr {
r = append(r, strings.Trim(e, " "))
}
return
}
2018-08-12 02:23:46 +08:00
func genAddr(port int, allowLan bool) string {
if allowLan {
return fmt.Sprintf(":%d", port)
}
return fmt.Sprintf("127.0.0.1:%d", port)
}