unnecessary assignment to the blank identifier
9)
10
11func imageIndex(img []image.Image, find image.Image) int {
12 for i, _ := range img {13 if img[i] == find {
14 return i
15 }
Description
Assigning to the blank identifier is unnecessary.
From the Go spec:
If the last iteration variable is the blank identifier, the range clause is equivalent to the same clause without that identifier.
Bad practice
for _ = range slc {}
x, _ = someMap[key]
_ = <-ch
Recommended
for range slc {}
x = someMap[key]
<-ch