mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
ws modify
This commit is contained in:
parent
299736b92a
commit
0e69f7953a
@ -1,17 +1,9 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
var (
|
||||
_, b, _, _ = runtime.Caller(0)
|
||||
// Root folder of this project
|
||||
Root = filepath.Join(filepath.Dir(b), "../../..")
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
var Config config
|
||||
@ -156,9 +148,8 @@ type config struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
// if we cd Open-IM-Server/src/utils and run go test
|
||||
// it will panic cannot find config/config.yaml
|
||||
bytes, err := ioutil.ReadFile(Root + "/config/config.yaml")
|
||||
path, _ := os.Getwd()
|
||||
bytes, err := ioutil.ReadFile(path + "/config/config.yaml")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user