Apply go fix -any ./...

This commit is contained in:
Michael Eischer
2026-07-22 22:25:18 +02:00
parent d4088aa09b
commit 32e9869cc8
63 changed files with 197 additions and 197 deletions
+5 -5
View File
@@ -181,7 +181,7 @@ var ErrNoSourceData = errors.Fatal("all source directories/files do not exist")
// filterExisting returns the items that exist and can be accessed. It returns
// ErrNoSourceData if none remain, or ErrInvalidSourceData if some were skipped.
func filterExisting(items []string, warnf func(msg string, args ...interface{})) (result []string, err error) {
func filterExisting(items []string, warnf func(msg string, args ...any)) (result []string, err error) {
for _, item := range items {
_, err := fs.Lstat(item)
if err != nil {
@@ -332,7 +332,7 @@ func (opts BackupOptions) Check(gopts global.Options, args []string) error {
// collectRejectByNameFuncs returns a list of all functions which may reject data
// from being saved in a snapshot based on path only
func collectRejectByNameFuncs(opts BackupOptions, repo *repository.Repository, warnf func(msg string, args ...interface{})) (fs []archiver.RejectByNameFunc, err error) {
func collectRejectByNameFuncs(opts BackupOptions, repo *repository.Repository, warnf func(msg string, args ...any)) (fs []archiver.RejectByNameFunc, err error) {
// exclude restic cache
if repo.Cache() != nil {
f, err := rejectResticCache(repo)
@@ -356,7 +356,7 @@ func collectRejectByNameFuncs(opts BackupOptions, repo *repository.Repository, w
// collectRejectFuncs returns a list of all functions which may reject data
// from being saved in a snapshot based on path and file info
func collectRejectFuncs(opts BackupOptions, targets []string, fs fs.FS, warnf func(msg string, args ...interface{})) (funcs []archiver.RejectFunc, err error) {
func collectRejectFuncs(opts BackupOptions, targets []string, fs fs.FS, warnf func(msg string, args ...any)) (funcs []archiver.RejectFunc, err error) {
// allowed devices
if opts.ExcludeOtherFS && !opts.Stdin && !opts.StdinCommand {
f, err := archiver.RejectByDevice(targets, fs)
@@ -404,7 +404,7 @@ func collectRejectFuncs(opts BackupOptions, targets []string, fs fs.FS, warnf fu
}
// collectTargets returns a list of target files/dirs from several sources.
func collectTargets(opts BackupOptions, args []string, warnf func(msg string, args ...interface{}), stdin io.ReadCloser) (targets []string, err error) {
func collectTargets(opts BackupOptions, args []string, warnf func(msg string, args ...any), stdin io.ReadCloser) (targets []string, err error) {
if opts.Stdin || opts.StdinCommand {
return nil, nil
}
@@ -589,7 +589,7 @@ func runBackup(ctx context.Context, opts BackupOptions, gopts global.Options, te
_ = progressReporter.Error(item, err)
}
messageHandler := func(msg string, args ...interface{}) {
messageHandler := func(msg string, args ...any) {
if !gopts.JSON {
printer.P(msg, args...)
}
+6 -6
View File
@@ -570,15 +570,15 @@ func (*jsonErrorPrinter) NewCounterTerminalOnly(_ string) restic.Counter {
return restic.NoopCounter
}
func (p *jsonErrorPrinter) E(msg string, args ...interface{}) {
func (p *jsonErrorPrinter) E(msg string, args ...any) {
status := checkError{
MessageType: "error",
Message: fmt.Sprintf(msg, args...),
}
p.term.Error(ui.ToJSONString(status))
}
func (*jsonErrorPrinter) S(_ string, _ ...interface{}) {}
func (*jsonErrorPrinter) P(_ string, _ ...interface{}) {}
func (*jsonErrorPrinter) PT(_ string, _ ...interface{}) {}
func (*jsonErrorPrinter) V(_ string, _ ...interface{}) {}
func (*jsonErrorPrinter) VV(_ string, _ ...interface{}) {}
func (*jsonErrorPrinter) S(_ string, _ ...any) {}
func (*jsonErrorPrinter) P(_ string, _ ...any) {}
func (*jsonErrorPrinter) PT(_ string, _ ...any) {}
func (*jsonErrorPrinter) V(_ string, _ ...any) {}
func (*jsonErrorPrinter) VV(_ string, _ ...any) {}
+2 -2
View File
@@ -84,7 +84,7 @@ type Comparer struct {
repo restic.BlobLoader
opts DiffOptions
printChange func(change *Change)
printError func(string, ...interface{})
printError func(string, ...any)
}
type Change struct {
@@ -158,7 +158,7 @@ type DiffStatsContainer struct {
}
// updateBlobs updates the blob counters in the stats struct.
func updateBlobs(repo restic.Loader, blobs restic.AssociatedBlobSet, stats *DiffStat, printError func(string, ...interface{})) {
func updateBlobs(repo restic.Loader, blobs restic.AssociatedBlobSet, stats *DiffStat, printError func(string, ...any)) {
for h := range blobs.Keys() {
switch h.Type {
case restic.DataBlob:
+6 -6
View File
@@ -136,9 +136,9 @@ type statefulOutput struct {
oldsn *data.Snapshot
hits int
printer interface {
S(string, ...interface{})
P(string, ...interface{})
E(string, ...interface{})
S(string, ...any)
P(string, ...any)
E(string, ...any)
}
stdout io.Writer
}
@@ -281,9 +281,9 @@ type Finder struct {
treeIDs map[string]struct{}
itemsFound int
printer interface {
S(string, ...interface{})
P(string, ...interface{})
E(string, ...interface{})
S(string, ...any)
P(string, ...any)
E(string, ...any)
}
}
+2 -2
View File
@@ -290,8 +290,8 @@ type textLsPrinter struct {
ListLong bool
HumanReadable bool
termPrinter interface {
P(msg string, args ...interface{})
S(msg string, args ...interface{})
P(msg string, args ...any)
S(msg string, args ...any)
}
}
+2 -2
View File
@@ -101,7 +101,7 @@ func TestLsNodeJSON(t *testing.T) {
rtest.Equals(t, expect+"\n", buf.String())
// Sanity check: output must be valid JSON.
var v interface{}
var v any
err = json.NewDecoder(buf).Decode(&v)
rtest.OK(t, err)
}
@@ -121,7 +121,7 @@ func TestLsNcduNode(t *testing.T) {
rtest.Equals(t, expect, string(out))
// Sanity check: output must be valid JSON.
var v interface{}
var v any
err = json.Unmarshal(out, &v)
rtest.OK(t, err)
}
+1 -1
View File
@@ -171,7 +171,7 @@ func runMount(ctx context.Context, opts MountOptions, gopts global.Options, args
}
}
systemFuse.Debug = func(msg interface{}) {
systemFuse.Debug = func(msg any) {
debug.Log("fuse: %v", msg)
}