From 3d9625b40b1fe815784b29666bfe6b6b11b0d307 Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Sat, 15 Nov 2025 16:10:14 -0800 Subject: [PATCH] Fix calls to die.With. --- dbg/dbg.go | 12 ++++++------ die/die.go | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dbg/dbg.go b/dbg/dbg.go index 1d8ca9d..5d53764 100644 --- a/dbg/dbg.go +++ b/dbg/dbg.go @@ -55,22 +55,22 @@ func To(w io.WriteCloser) *DebugPrinter { } // Print calls fmt.Print if Enabled is true. -func (dbg *DebugPrinter) Print(v any) { +func (dbg *DebugPrinter) Print(v ...any) { if dbg.Enabled { - fmt.Fprint(dbg.out, v) + fmt.Fprint(dbg.out, v...) } } // Println calls fmt.Println if Enabled is true. -func (dbg *DebugPrinter) Println(v any) { +func (dbg *DebugPrinter) Println(v ...any) { if dbg.Enabled { - fmt.Fprintln(dbg.out, v) + fmt.Fprintln(dbg.out, v...) } } // Printf calls fmt.Printf if Enabled is true. -func (dbg *DebugPrinter) Printf(format string, v any) { +func (dbg *DebugPrinter) Printf(format string, v ...any) { if dbg.Enabled { - fmt.Fprintf(dbg.out, format, v) + fmt.Fprintf(dbg.out, format, v...) } } diff --git a/die/die.go b/die/die.go index 5ecc0a8..6b83ccc 100644 --- a/die/die.go +++ b/die/die.go @@ -16,15 +16,15 @@ func If(err error) { } // With prints the message to stderr, appending a newline, and exits. -func With(fstr string, args any) { +func With(fstr string, args ...any) { out := fmt.Sprintf("[!] %s\n", fstr) - fmt.Fprintf(os.Stderr, out, args) + fmt.Fprintf(os.Stderr, out, args...) os.Exit(1) } // When prints the error to stderr and exits if cond is true. -func When(cond bool, fstr string, args any) { +func When(cond bool, fstr string, args ...any) { if cond { - With(fstr, args) + With(fstr, args...) } }