aboutsummaryrefslogtreecommitdiff
path: root/internal/utils/fprintf.go
blob: e1680d0c21dffae74e0cd33fa356493099798c2f (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package utils

import (
	"fmt"
	"io"
)

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

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