shithub: furgit

Download patch

ref: 3ec995bbe8009d1550ea3e2005e7e544aac2ad2e
parent: 5526d6d8d606b40105bc0151f037d21b1f590c08
author: Runxi Yu <me@runxiyu.org>
date: Sat Mar 7 22:21:58 EST 2026

internal/utils: Add WriteProgressf

--- /dev/null
+++ b/internal/utils/progress.go
@@ -1,0 +1,18 @@
+// Package utils provides misc utilities.
+package utils
+
+import (
+	"fmt"
+	"io"
+)
+
+// WriteProgressf writes one formatted progress message to w.
+//
+// It is nil-safe and ignores write errors by design.
+func WriteProgressf(w io.Writer, format string, args ...any) {
+	if w == nil {
+		return
+	}
+
+	_, _ = fmt.Fprintf(w, format, args...)
+}
--