Closed Juneezee closed 1 year ago
An additional nil check for q before the loop is unnecessary because q is a map. A nil map is equivalent to an empty map. (Example: https://go.dev/play/p/EnnDEF7svOd)
q
map
Before:
if q != nil { for key, val := range q { ... } }
After:
for key, val := range q { ... }
An additional nil check for
q
before the loop is unnecessary becauseq
is amap
. A nilmap
is equivalent to an empty map. (Example: https://go.dev/play/p/EnnDEF7svOd)Before:
After: