mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 21:22:16 +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")
|
bytes, err := ioutil.ReadFile(Root + "/config/config.yaml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
if err = yaml.Unmarshal(bytes, &Config); err != nil {
|
if err = yaml.Unmarshal(bytes, &Config); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestServerIP(t *testing.T) {
|
func TestServerIP(t *testing.T) {
|
||||||
if ServerIP == "" {
|
if net.ParseIP(ServerIP) == nil {
|
||||||
t.Fail()
|
t.Fail()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user