Skip to content

Commit 1fb6b84

Browse files
committed
Fix staticcheck QF1003 lint in glob.go
1 parent 15fc8b5 commit 1fb6b84

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

toml/glob.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ func globToRegexp(pattern string) *regexp.Regexp {
2828
switch {
2929
case ch == '\\' && i+1 < len(pattern):
3030
next := pattern[i+1]
31-
if next == '*' {
31+
switch next {
32+
case '*':
3233
b.WriteString(regexp.QuoteMeta("*"))
33-
} else if next == '\\' {
34+
case '\\':
3435
b.WriteString(regexp.QuoteMeta("\\"))
35-
} else {
36+
default:
3637
b.WriteString(regexp.QuoteMeta(string(next)))
3738
}
3839
i += 2

0 commit comments

Comments
 (0)