Go

Go

Made by DeepSource

Found for loop instead of append SCC-S1011

Anti-pattern
Major
Autofix

There is no need to range over the slice and append elements one by one; instead, use append because it's clear, simple, and idiomatic.

Bad practice

a := []int{1, 2}
b := []int{3, 4}
for _, v := range a {
    b = append(b, v)
}

Recommended

a := []int{1, 2}
b := []int{3, 4}
b = append(b, a...)