Browse Source

isNet before merge

nosocat
Jean-Louis Huynen 3 years ago
parent
commit
20ec7e97a6
  1. 13
      d4-goclient.go

13
d4-goclient.go

@ -9,8 +9,10 @@ import (
"fmt"
"io"
"log"
"net"
"os"
"strconv"
"strings"
"time"
//BSD 3
@ -209,6 +211,17 @@ func d4checkConfig(d4 *d4S) bool {
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 {
uuid, err := uuid.NewV4()
if err != nil {

Loading…
Cancel
Save