From 3ec995bbe8009d1550ea3e2005e7e544aac2ad2e Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Mar 2026 03:21:58 +0800 Subject: internal/utils: Add WriteProgressf --- internal/utils/progress.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 internal/utils/progress.go (limited to 'internal/utils') diff --git a/internal/utils/progress.go b/internal/utils/progress.go new file mode 100644 index 00000000..f97dedc6 --- /dev/null +++ b/internal/utils/progress.go @@ -0,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...) +} -- cgit v1.3.1-10-gc9f91