fix: workdir path error

This commit is contained in:
deepzz0
2021-05-08 10:54:21 +08:00
parent 79ac024312
commit c18f3b7da9
7 changed files with 40 additions and 7 deletions

View File

@@ -135,10 +135,7 @@ type Config struct {
func init() {
// compatibility linux and windows
var err error
if gopath := os.Getenv("GOPATH"); gopath != "" {
WorkDir = filepath.Join(gopath, "src", "github.com",
"eiblog", "eiblog")
}
WorkDir = workDir()
path := filepath.Join(WorkDir, "conf", "app.yml")
data, err := ioutil.ReadFile(path)