From 85e276eef47ebe037317189aa2fe468e764735d5 Mon Sep 17 00:00:00 2001 From: Georg Reinke Date: Sat, 9 Nov 2024 14:24:42 +0100 Subject: [PATCH] variant: don't output unneeded space when formatting structs --- variant.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/variant.go b/variant.go index cea77fb..93a2ee8 100644 --- a/variant.go +++ b/variant.go @@ -130,7 +130,10 @@ func (v Variant) format() (string, bool) { s, b := MakeVariant(rv.Field(i).Interface()).format() unamb = unamb && b buf.WriteString(s) - buf.WriteString(", ") + buf.WriteString(",") + if i != rv.NumField()-1 { + buf.WriteString(" ") + } } buf.WriteByte(')') return buf.String(), unamb