nil
check around loop SCC-S1031113}
114
115func merge(base, extra url.Values) url.Values {
116 if extra != nil {117 for key, values := range extra {
118 for _, value := range values {
119 base.Add(key, value)
When using range
on nil slices and maps, the loop will never execute,
as the length of the iterable will be regarded as zero. This makes an additional
nil
check around the loop unnecessary.
if s != nil {
for _, x := range s {
// ...
}
}
for _, x := range s {
// ...
}