mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 19:27:46 +08:00
fix issue in gfile.MainPkgPath
This commit is contained in:
parent
33b24eba01
commit
16d978dc58
@ -426,7 +426,7 @@ func MainPkgPath() string {
|
||||
}
|
||||
// separator of <file> '/' will be converted to Separator.
|
||||
path = Dir(file)
|
||||
for path != "/" && gstr.Contains(path, Separator) {
|
||||
for path[len(path) - 1] != os.PathSeparator {
|
||||
files, _ := ScanDir(path, "*.go")
|
||||
for _, v := range files {
|
||||
if gregex.IsMatchString(`package\s+main`, GetContents(v)) {
|
||||
|
Loading…
Reference in New Issue
Block a user