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
+1 -1
View File
@@ -62,7 +62,7 @@ var genericAttributesForOS = map[GenericAttributeType]osType{}
func storeGenericAttributeType(attributeTypes ...GenericAttributeType) {
for _, attributeType := range attributeTypes {
// Get the OS attribute type from the GenericAttributeType
osAttributeName := strings.Split(string(attributeType), ".")[0]
osAttributeName, _, _ := strings.Cut(string(attributeType), ".")
genericAttributesForOS[attributeType] = osType(osAttributeName)
}
}
+3 -2
View File
@@ -3,6 +3,7 @@ package data
import (
"context"
"runtime"
"slices"
"sync"
"github.com/restic/restic/internal/debug"
@@ -158,8 +159,8 @@ func filterTrees(ctx context.Context, repo restic.Loader, trees restic.IDs, load
debug.Log("input job tree %v", j.ID)
// iterate backwards over subtree to compensate backwards traversal order of nextTreeID selection
for i := len(j.Subtrees) - 1; i >= 0; i-- {
id := j.Subtrees[i]
for _, id := range slices.Backward(j.Subtrees) {
if id.IsNull() {
// We do not need to raise this error here, it is
// checked when the tree is checked. Just make sure