mirror of
https://github.com/restic/restic.git
synced 2026-08-31 17:57:13 +00:00
Apply go fix ./... (#22037)
This commit is contained in:
@@ -2,6 +2,7 @@ package filter
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/restic/restic/internal/errors"
|
||||
@@ -195,12 +196,12 @@ func match(pattern Pattern, strs []string) (matched bool, err error) {
|
||||
outer:
|
||||
for offset := maxOffset; offset >= minOffset; offset-- {
|
||||
|
||||
for i := len(pattern.parts) - 1; i >= 0; i-- {
|
||||
for i, v := range slices.Backward(pattern.parts) {
|
||||
var ok bool
|
||||
if pattern.parts[i].isSimple {
|
||||
ok = pattern.parts[i].pattern == strs[offset+i]
|
||||
if v.isSimple {
|
||||
ok = v.pattern == strs[offset+i]
|
||||
} else {
|
||||
ok, err = filepath.Match(pattern.parts[i].pattern, strs[offset+i])
|
||||
ok, err = filepath.Match(v.pattern, strs[offset+i])
|
||||
if err != nil {
|
||||
return false, errors.Wrap(err, "Match")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user