File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -27,27 +27,27 @@ func Match(pattern, name string) (matched bool) {
2727 if pattern == "*" {
2828 return true
2929 }
30- // Does extended wildcard '*' and '?' match.
31- return deepMatchRune ([] rune ( name ), [] rune ( pattern ) , false )
30+ // Does extended wildcard '*' and '?' match?
31+ return deepMatchRune (name , pattern , false )
3232}
3333
34- func deepMatchRune (str , pattern [] rune , simple bool ) bool {
34+ func deepMatchRune (s , pattern string , simple bool ) bool {
3535 for len (pattern ) > 0 {
3636 switch pattern [0 ] {
3737 default :
38- if len (str ) == 0 || str [0 ] != pattern [0 ] {
38+ if len (s ) == 0 || s [0 ] != pattern [0 ] {
3939 return false
4040 }
4141 case '?' :
42- if len (str ) == 0 && ! simple {
42+ if len (s ) == 0 && ! simple {
4343 return false
4444 }
4545 case '*' :
46- return deepMatchRune (str , pattern [1 :], simple ) ||
47- (len (str ) > 0 && deepMatchRune (str [1 :], pattern , simple ))
46+ return deepMatchRune (s , pattern [1 :], simple ) ||
47+ (len (s ) > 0 && deepMatchRune (s [1 :], pattern , simple ))
4848 }
49- str = str [1 :]
49+ s = s [1 :]
5050 pattern = pattern [1 :]
5151 }
52- return len (str ) == 0 && len (pattern ) == 0
52+ return len (s ) == 0 && len (pattern ) == 0
5353}
You can’t perform that action at this time.
0 commit comments