mirror of
https://gitee.com/johng/gf
synced 2026-06-30 11:05:11 +08:00
improve gfile.MainPkgPath
This commit is contained in:
@ -454,6 +454,9 @@ func MainPkgPath() string {
|
||||
if gstr.Contains(file, "/gf/g/") {
|
||||
continue
|
||||
}
|
||||
if Ext(file) != ".go" {
|
||||
continue
|
||||
}
|
||||
path = file
|
||||
for path != "/" && gstr.Contains(path, "/") {
|
||||
files, _ := ScanDir(path, "*.go")
|
||||
|
||||
@ -653,8 +653,8 @@ func TestMkdir(t *testing.T) {
|
||||
func TestStat(t *testing.T) {
|
||||
gtest.Case(t, func() {
|
||||
var (
|
||||
tpath1 string = "/testfile_t1.txt"
|
||||
tpath2 string = "./testfile_t1_no.txt"
|
||||
tpath1 = "/testfile_t1.txt"
|
||||
tpath2 = "./testfile_t1_no.txt"
|
||||
err error
|
||||
fileiofo os.FileInfo
|
||||
)
|
||||
@ -675,12 +675,7 @@ func TestStat(t *testing.T) {
|
||||
|
||||
func TestMainPkgPath(t *testing.T) {
|
||||
gtest.Case(t, func() {
|
||||
var (
|
||||
reads string
|
||||
)
|
||||
|
||||
reads = gfile.MainPkgPath()
|
||||
reads := gfile.MainPkgPath()
|
||||
gtest.Assert(reads, "")
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user