feat: test ServerIP

This commit is contained in:
Yaxian 2021-10-21 10:08:37 +08:00
parent 69169c158d
commit 4183386b98
2 changed files with 2 additions and 3 deletions

View File

@ -161,11 +161,9 @@ func init() {
bytes, err := ioutil.ReadFile(Root + "/config/config.yaml")
if err != nil {
panic(err)
return
}
if err = yaml.Unmarshal(bytes, &Config); err != nil {
panic(err)
return
}
}

View File

@ -1,11 +1,12 @@
package utils
import (
"net"
"testing"
)
func TestServerIP(t *testing.T) {
if ServerIP == "" {
if net.ParseIP(ServerIP) == nil {
t.Fail()
}
}