From 30dcf49c62ccd04ddf88725fcc916846cb8ef05f Mon Sep 17 00:00:00 2001 From: jholdstock Date: Fri, 11 Apr 2025 09:43:29 +0100 Subject: [PATCH] vote-validator: Simplify f.WriteString fmt.Fprintf acheives the same thing in a single func. --- cmd/vote-validator/results.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/vote-validator/results.go b/cmd/vote-validator/results.go index c471013..8da42b9 100644 --- a/cmd/vote-validator/results.go +++ b/cmd/vote-validator/results.go @@ -29,8 +29,8 @@ func (r *results) writeFile(path string) (bool, error) { return false, fmt.Errorf("opening log file failed: %w", err) } - write := func(f *os.File, str string, a ...any) { - _, err := f.WriteString(fmt.Sprintf(str+"\n", a...)) + write := func(f *os.File, format string, a ...any) { + _, err := fmt.Fprintf(f, format+"\n", a...) if err != nil { f.Close() panic(fmt.Sprintf("writing to log file failed: %v", err))