shithub: furgit

ref: 3ce59c3248dec0eb0f918c42f37f53bc2ac20425
dir: /internal/utils/progress.go/

View raw version
// Package utils provides misc utilities.
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...)
}