(k protoreflect.MapKey)
| 599 | } |
| 600 | } |
| 601 | func (x *testMap) Mutable(k protoreflect.MapKey) protoreflect.Value { |
| 602 | if x.fd.MapValue().Message() == nil { |
| 603 | panic("invalid Mutable on map with non-message value type") |
| 604 | } |
| 605 | v := x.Get(k) |
| 606 | if !v.IsValid() { |
| 607 | v = x.NewValue() |
| 608 | x.Set(k, v) |
| 609 | } |
| 610 | return v |
| 611 | } |
| 612 | func (x *testMap) Clear(k protoreflect.MapKey) { x.val.SetMapIndex(x.key(k), reflect.Value{}) } |
| 613 | func (x *testMap) Range(f func(protoreflect.MapKey, protoreflect.Value) bool) { |
| 614 | iter := x.val.MapRange() |