Skip to content

inefficient-sprintf

Default severity: warning

Simple %s, %t, and base-10 integer conversions can use the string directly or the corresponding strconv function without format parsing and reflection.

text := fmt.Sprintf("%d", number)
text := strconv.Itoa(number)