I have a list of things in a go program. I want to loop over them, and perform some operation on/with a subset of those things. Is there more elegant/idiomatic code for doing this than the following?
for key, value := range listOfThings {
if(!value.Enabled) {
continue;
}
doTheThing(key, value)
}
The large context -- I'm coming from languages where map/reduce/filter/etc are popular patterns for this sort of thing, but word on the internet is that those sorts of higher level abstractions aren't really a go-ish thing to do.
Is there something more elegant than guard/continue
clauses in my range blocks for this sort of code?