isNet before merge

nosocat
Jean-Louis Huynen 2019-01-15 10:30:04 +01:00
parent dc26216e44
commit 6291fa1257
1 changed files with 13 additions and 0 deletions

View File

@ -9,8 +9,10 @@ import (
"fmt" "fmt"
"io" "io"
"log" "log"
"net"
"os" "os"
"strconv" "strconv"
"strings"
"time" "time"
//BSD 3 //BSD 3
@ -211,6 +213,17 @@ func d4checkConfig(d4 *d4S) bool {
return true return true
} }
func isNet(d []byte) (bool, []string) {
ss := strings.Split(string(d), ":")
if len(ss) != 1 {
if net.ParseIP(ss[0]) != nil {
infof(fmt.Sprintf("Server IP: %s, Server Port: %s\n", ss[0], ss[1]))
return true, make([]string, 0)
}
}
return false, ss
}
func generateUUIDv4() []byte { func generateUUIDv4() []byte {
uuid, err := uuid.NewV4() uuid, err := uuid.NewV4()
if err != nil { if err != nil {