Skip to content

invalid-printf-call

Default severity: error

Printf-style calls interpret a small language of verbs, argument indexes, widths, and precisions. This check validates constant formats against the resolved call and its variadic arguments.

It reports malformed formats, unknown verbs, missing or extra arguments, non-integer dynamic width or precision arguments, unsupported %w wrapping, and incompatible value types. Calls with a spread variadic slice are accepted when their individual values cannot be determined statically.

fmt.Printf("%d %s", name, count)
fmt.Printf("%d %s", count, name)