Skip to content

argument-overwritten-before-use

Detect arguments replaced before their incoming value is used.

Updated View as Markdown

Default severity: warning

Overwriting a function argument before reading its incoming value makes that input meaningless. The assignment may be accidental, or the argument may no longer belong in the function signature.

Bad

func normalize(value string) string { value = fallback; return value }

Good

func normalize(value string) string { use(value); value = fallback; return value }
Navigation

Type to search…

↑↓ navigate↵ selectEsc close