diff --git a/src/common/config/config.go b/src/common/config/config.go index 93b17a81f..6294a031c 100644 --- a/src/common/config/config.go +++ b/src/common/config/config.go @@ -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 } } diff --git a/src/utils/get_server_ip_test.go b/src/utils/get_server_ip_test.go index 161037983..54e2142ef 100644 --- a/src/utils/get_server_ip_test.go +++ b/src/utils/get_server_ip_test.go @@ -1,11 +1,12 @@ package utils import ( + "net" "testing" ) func TestServerIP(t *testing.T) { - if ServerIP == "" { + if net.ParseIP(ServerIP) == nil { t.Fail() } }