Skip to content

single-argument-append

Detect append calls that add no elements.

Updated View as Markdown

Default severity: warning

Calling the predeclared append function with only a slice argument returns that same slice unchanged. Assign or return the slice directly instead.

Bad

destination = append(source)

Good

destination = source
Navigation

Type to search…

↑↓ navigate↵ selectEsc close