diff --git a/os/gcfg/gcfg.go b/os/gcfg/gcfg.go index 196e9cc1f..d3a16be53 100644 --- a/os/gcfg/gcfg.go +++ b/os/gcfg/gcfg.go @@ -11,6 +11,7 @@ import ( "bytes" "errors" "fmt" + "github.com/gogf/gf/text/gstr" "github.com/gogf/gf/os/gres" @@ -93,6 +94,7 @@ func (c *Config) filePath(file ...string) (path string) { c.paths.RLockFunc(func(array []string) { index := 1 for _, v := range array { + v = gstr.TrimRight(v, `\/`) buffer.WriteString(fmt.Sprintf("\n%d. %s", index, v)) index++ buffer.WriteString(fmt.Sprintf("\n%d. %s", index, v+gfile.Separator+"config")) @@ -274,6 +276,7 @@ func (c *Config) FilePath(file ...string) (path string) { // Searching the file system. c.paths.RLockFunc(func(array []string) { for _, prefix := range array { + prefix = gstr.TrimRight(prefix, `\/`) if path, _ = gspath.Search(prefix, name); path != "" { return } diff --git a/os/glog/glog_logger.go b/os/glog/glog_logger.go index fafb65012..21c82a74b 100644 --- a/os/glog/glog_logger.go +++ b/os/glog/glog_logger.go @@ -24,6 +24,7 @@ import ( "github.com/gogf/gf/util/gconv" ) +// Logger is the struct for logging management. type Logger struct { parent *Logger // Parent logger. config Config // Logger configuration.