mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
90564f9fb0e2c688958be782363c9b9706fc20b9
This pull request introduces a new glob pattern matching utility to the `gfile` package, adding support for advanced glob patterns including the "**" (globstar) operator, which matches across directory boundaries, similar to bash and gitignore. It also includes a comprehensive set of unit tests to verify the correctness and cross-platform compatibility of the new functionality. **Glob pattern matching feature:** * Added `MatchGlob` function to `gfile`, which extends `filepath.Match` with support for the "**" (globstar) pattern, enabling recursive directory matching and more flexible file pattern matching. * Implemented internal helpers (`matchGlobstar` and `doMatchGlobstar`) to handle normalization of path separators and recursive matching logic for patterns containing "**". **Testing and validation:** * Added `gfile_z_unit_match_test.go` with extensive unit tests covering basic glob patterns, globstar usage, prefix/suffix combinations, multiple globstars, edge cases, and Windows path compatibility to ensure robust and cross-platform behavior. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: houseme <housemecn@gmail.com>
English | 简体中文
A powerful framework for faster, easier, and more efficient project development.
Documentation
- Official Site: https://goframe.org
- Official Site(en): https://goframe.org/en
- 国内镜像: https://goframe.org.cn
- Mirror Site: Github Pages
- Mirror Site: Offline Docs
- GoDoc API: https://pkg.go.dev/github.com/gogf/gf/v2
Contributors
💖 Thanks to all the contributors who made GoFrame possible 💖
License
GoFrame is licensed under the MIT License, 100% free and open-source, forever.
Languages
GO
100%
