|
|
|
|
|
by iudqnolq
1348 days ago
|
|
If so, it's a bit misleading. The go bug just requires a reference, rather than a lambda. I bucket lambdas into a category of language features I expect to have more sharp edges around capture semantics than references. Bug: var all []*Item
for _, item := range items {
all = append(all, &item)
}
Fix: var all []*Item
for _, item := range items {
item := item
all = append(all, &item)
}
|
|