diff options
| author | 2026-03-08 03:21:58 +0800 | |
|---|---|---|
| committer | 2026-03-08 03:21:58 +0800 | |
| commit | 3ec995bbe8009d1550ea3e2005e7e544aac2ad2e (patch) | |
| tree | 59e8ef3b589c903edf59dc49b1c1b5618e1a4466 /internal/utils/progress.go | |
| parent | receivepack: Progress writing and such (diff) | |
| signature | No signature | |
internal/utils: Add WriteProgressf
Diffstat (limited to 'internal/utils/progress.go')
| -rw-r--r-- | internal/utils/progress.go | 18 |
1 files changed, 18 insertions, 0 deletions
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...) +} |
