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
9f8c481992
commit
13eb1150a5
@ -425,8 +425,7 @@ func MainPkgPath() string {
|
||||
continue
|
||||
}
|
||||
// separator of <file> '/' will be converted to Separator.
|
||||
path = Dir(file)
|
||||
for path[len(path) - 1] != os.PathSeparator {
|
||||
for path = Dir(file); len(path) > 1 && Exists(path) && 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