Skip to content

Commit

Permalink
fea: 测试单元寻找配置目录
Browse files Browse the repository at this point in the history
  • Loading branch information
cyz-home committed Jun 1, 2023
1 parent 983233d commit 4c98e7e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bootstrap/providers/config_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ func (c *ConfigProvider) initFile() {
parDir := ""
for i := 0; i <= 100; i++ {
checkDir := pwd + parDir
if _, err := os.Stat(checkDir + "/go.mod"); err == nil {
_, err1 := os.Stat(checkDir + "/go.mod")
_, err2 := os.Stat(checkDir + "/.env")
if err1 == nil || err2 == nil {
dirs, _ := filepath.Abs(checkDir + "/" + defaultDir)
DirEntry, err = os.ReadDir(dirs)
if err != nil {
Expand Down

0 comments on commit 4c98e7e

Please sign in to comment.