mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 05:02:11 +08:00
feat: test ServerIP
This commit is contained in:
parent
69169c158d
commit
4183386b98
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"net"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestServerIP(t *testing.T) {
|
||||
if ServerIP == "" {
|
||||
if net.ParseIP(ServerIP) == nil {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user