2018-07-26 00:04:59 +08:00
|
|
|
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)
|
|
|
|
}
|