vote-validator: Simplify f.WriteString
fmt.Fprintf acheives the same thing in a single func.
This commit is contained in:
parent
4b2219938c
commit
30dcf49c62
@ -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))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user