This commit is contained in:
John Guo 2022-08-16 20:46:22 +08:00 committed by GitHub
parent 7a3176ea77
commit eff46bd1db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,7 +121,11 @@ func filterFileByFilters(file string, filters []string) (filtered bool) {
}
// GOROOT filter.
if goRootForFilter != "" && len(file) >= len(goRootForFilter) && file[0:len(goRootForFilter)] == goRootForFilter {
return true
// https://github.com/gogf/gf/issues/2047
fileSeparator := file[len(goRootForFilter)]
if fileSeparator == filepath.Separator || fileSeparator == '\\' || fileSeparator == '/' {
return true
}
}
return false
}