Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new MatchGlob function to the gfile package that extends standard glob pattern matching with support for the ** (globstar) operator, enabling recursive directory matching similar to bash globstar and gitignore patterns.
Key Changes:
- Implemented
MatchGlobfunction with globstar support that falls back tofilepath.Matchfor simple patterns - Added internal recursive matching logic (
matchGlobstaranddoMatchGlobstar) to handle path normalization and globstar expansion - Comprehensive test suite covering basic patterns, globstar variations, edge cases, and Windows path compatibility
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| os/gfile/gfile_match.go | New file implementing the MatchGlob function with globstar pattern matching support and helper functions for path normalization and recursive matching |
| os/gfile/gfile_z_unit_match_test.go | Comprehensive unit tests covering basic glob patterns, globstar usage in various configurations, multiple globstars, edge cases, and cross-platform path handling |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…and memoization cache scenarios
… and utility functions
houseme
approved these changes
Dec 26, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new glob pattern matching utility to the
gfilepackage, 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:
MatchGlobfunction togfile, which extendsfilepath.Matchwith support for the "**" (globstar) pattern, enabling recursive directory matching and more flexible file pattern matching.matchGlobstaranddoMatchGlobstar) to handle normalization of path separators and recursive matching logic for patterns containing "**".Testing and validation:
gfile_z_unit_match_test.gowith 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.