stretchr / objx

Go package for dealing with maps, slices, JSON and other data.
MIT License
695 stars 75 forks source link

.Each(...) for MSI values #5

Closed nelsam closed 10 years ago

nelsam commented 10 years ago

As it stands, Value.Each only works for slices; either a Map.Each or Value.MSIEach that accepts a function (e.g. func(key string, value interface{}) bool) would be nice.

Although, I have an aversion to MSIEach just because it has "MSIE" in it. But that's just me.

matryer commented 10 years ago

This should work:

var m objx.Map = /* get from somewhere */
for key, value := range m { 
  ...
}
nelsam commented 10 years ago

Err... Never mind, brain fart.

matryer commented 10 years ago

Hahahaha - +1 re MSIE avoidance

On 18 Sep 2013, at 11:09, nelsam notifications@github.com wrote:

As it stands, Value.Each only works for slices; either a Map.Each or Value.MSIEach that accepts a function (e.g. func(key string, value interface{}) bool) would be nice.

Although, I have an aversion to MSIEach just because it has "MSIE" in it. But that's just me.

— Reply to this email directly or view it on GitHub.