mirror of
https://gitee.com/johng/gf.git
synced 2024-12-03 04:37:49 +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.
|
// separator of <file> '/' will be converted to Separator.
|
||||||
path = Dir(file)
|
path = Dir(file)
|
||||||
for path != "/" && gstr.Contains(path, Separator) {
|
for path[len(path) - 1] != os.PathSeparator {
|
||||||
files, _ := ScanDir(path, "*.go")
|
files, _ := ScanDir(path, "*.go")
|
||||||
for _, v := range files {
|
for _, v := range files {
|
||||||
if gregex.IsMatchString(`package\s+main`, GetContents(v)) {
|
if gregex.IsMatchString(`package\s+main`, GetContents(v)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user