shithub: furgit

ref: cf02f2958c191bea02126faf8daf72a7aae76bd9
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...)
}