github.com/fjl/memsize@v0.0.2/mapiter_go12.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  	it := m.MapRange()
     9  	for it.Next() {
    10  		fn(it.Key(), it.Value())
    11  	}
    12  }