github.com/fjl/memsize@v0.0.2/mapiter_old.go (about)

     1  // +build !go1.12
     2  
     3  package memsize
     4  
     5  import "reflect"
     6  
     7  func iterateMap(m reflect.Value, fn func(k, v reflect.Value)) {
     8  	for _, k := range m.MapKeys() {
     9  		fn(k, m.MapIndex(k))
    10  	}
    11  }