aboutsummaryrefslogtreecommitdiff
path: root/internal/utils/progress.go
blob: acb763acf41068409799d21349c4f552adc8e0e1 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Package utils provides misc utilities.
package utils

import (
	"fmt"
	"io"
)

// FprintfBestEffort writes one formatted message to w.
//
// It is nil-safe and ignores write errors by design.
func FprintfBestEffort(w io.Writer, format string, args ...any) {
	if w == nil {
		return
	}

	_, _ = fmt.Fprintf(w, format, args...)
}