From 6fc5d416a289235dd4bb56d29fb96c5a003ea89f Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 11 Jun 2022 22:30:35 -0600 Subject: use %v when possible Exceptions are - the occasional %x when the type is a basic int - %w - %q - %T - whenever print_tree.go needs to be dumb for compatibility with C --- pkg/util/fmt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/util/fmt.go') diff --git a/pkg/util/fmt.go b/pkg/util/fmt.go index c0ff596..af7404c 100644 --- a/pkg/util/fmt.go +++ b/pkg/util/fmt.go @@ -16,13 +16,13 @@ func FmtStateString(st fmt.State, verb rune) string { } } if width, ok := st.Width(); ok { - fmt.Fprintf(&ret, "%d", width) + fmt.Fprintf(&ret, "%v", width) } if prec, ok := st.Precision(); ok { if prec == 0 { ret.WriteByte('.') } else { - fmt.Fprintf(&ret, ".%d", prec) + fmt.Fprintf(&ret, ".%v", prec) } } ret.WriteRune(verb) -- cgit v1.2.3-2-g168b