231
232func names(mapWithNames map[string]struct{}) []string {
233 var names []string
234 for name, _ := range mapWithNames {235 names = append(names, name)
236 }
237
23func (v StaticVariables) List() ([]Reference, error) {
24 var refs []Reference
25
26 for name, _ := range v { 27 refs = append(refs, Reference{Path: name})
28 }
29
27 return nil, err
28 }
29
30 for i, _ := range refs {31 refs[i].Source = source
32 }
33
194 select {
195 case <-ticker.C:
196 bus.notifyCacheLock.Lock()
197 for channel, _ := range bus.notifyCache {198 if bus.watchedMap.BeingWatched(channel) {
199 bus.notify(channel)
200 }
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.
for _ = range slc {}
x, _ = someMap[key]
_ = <-ch
for range slc {}
x = someMap[key]
<-ch