Apply go fix ./... (#22037)

This commit is contained in:
Michael Eischer
2026-08-29 21:02:05 +02:00
committed by GitHub
parent 28d802df8c
commit b593ba305b
6 changed files with 19 additions and 15 deletions
+5 -4
View File
@@ -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")
}