testify
testify copied to clipboard
refactor: use %q and %T to simplify fmt.Sprintf
Summary
The PR simplifies strings inside fmt.Sprintf statements.
Changes
Replace "\"%s\"" with %q.
Replace fmt.Sprintf("\"%s"\", reflect.TypeOf(t)) with fmt.Sprintf("%T", t).
Motivation
%q has fewer symbols than "\"%s\"" but means the same for strings. See https://pkg.go.dev/fmt#hdr-Printing:
%q a double-quoted string safely escaped with Go syntax
%T is also shorter than reflect.TypeOf.