diff options
| author | 2026-06-08 05:49:14 +0000 | |
|---|---|---|
| committer | 2026-06-08 05:49:14 +0000 | |
| commit | 72289ba472f3e5bdc2fed0d38b1767dc6a5972b9 (patch) | |
| tree | fe6f1a76bda15670398f7dfe6be17b5e9b53ec8b /internal/utils/fprintf.go | |
| parent | REFACTOR: priorityqueue is done (diff) | |
| signature | No signature | |
internal/utils: Add best effort Fprintf
Diffstat (limited to 'internal/utils/fprintf.go')
| -rw-r--r-- | internal/utils/fprintf.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/utils/fprintf.go b/internal/utils/fprintf.go new file mode 100644 index 00000000..e1680d0c --- /dev/null +++ b/internal/utils/fprintf.go @@ -0,0 +1,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...) +} |
