From 4c94678d7dc87168ef6266cdd63b083f1a6a0b21 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 10 May 2026 17:50:49 +0200 Subject: [PATCH] fix linter and compilation issues --- cmd/restic/cmd_stats.go | 6 +++--- internal/fs/fs_local_vss_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/restic/cmd_stats.go b/cmd/restic/cmd_stats.go index 8578a481c..ac4e860aa 100644 --- a/cmd/restic/cmd_stats.go +++ b/cmd/restic/cmd_stats.go @@ -456,8 +456,8 @@ func (s *sizeHistogram) Add(size uint64) { func (s sizeHistogram) String() string { var out strings.Builder - out.WriteString(fmt.Sprintf("Count: %d\n", s.count)) - out.WriteString(fmt.Sprintf("Total Size: %s\n", ui.FormatBytes(s.totalSize))) + fmt.Fprintf(&out, "Count: %d\n", s.count) + fmt.Fprintf(&out, "Total Size: %s\n", ui.FormatBytes(s.totalSize)) t := table.New() t.AddColumn("Size", "{{.SizeRange}}") @@ -506,7 +506,7 @@ func (s sizeHistogram) String() string { _ = t.Write(&out) if len(s.oversized) > 0 { - out.WriteString(fmt.Sprintf("Oversized: %v\n", s.oversized)) + fmt.Fprintf(&out, "Oversized: %v\n", s.oversized) } return out.String() } diff --git a/internal/fs/fs_local_vss_test.go b/internal/fs/fs_local_vss_test.go index 9628cc4ef..15536804e 100644 --- a/internal/fs/fs_local_vss_test.go +++ b/internal/fs/fs_local_vss_test.go @@ -108,7 +108,7 @@ func TestVSSConfig(t *testing.T) { t.Fatalf("unexpected error (%v)", err) } messageHandler := func(msg string, args ...interface{}) { - t.Fatalf("unexpected message (%s)", fmt.Sprintf(msg, args)) + t.Fatalf("unexpected message (%s)", fmt.Sprintf(msg, args...)) } dst := NewLocalVss(errorHandler, messageHandler, cfg) @@ -202,7 +202,7 @@ func TestParseMountPoints(t *testing.T) { log = append(log, strings.TrimSpace(err.Error())) } messageHandler := func(msg string, args ...interface{}) { - t.Fatalf("unexpected message (%s)", fmt.Sprintf(msg, args)) + t.Fatalf("unexpected message (%s)", fmt.Sprintf(msg, args...)) } dst := NewLocalVss(errorHandler, messageHandler, cfg) @@ -304,7 +304,7 @@ func TestVSSFS(t *testing.T) { if strings.HasPrefix(msg, "creating VSS snapshot for") || strings.HasPrefix(msg, "successfully created snapshot") { return } - t.Fatalf("unexpected message (%s)", fmt.Sprintf(msg, args)) + t.Fatalf("unexpected message (%s)", fmt.Sprintf(msg, args...)) } localVss := NewLocalVss(errorHandler, messageHandler, cfg)