func (m *Map) Add(val Value) error {
	delta, ok := val.(*Map)
	if !ok {
		return errors.New("incompatible value to add")
	}
	m.mu.Lock()
	defer m.mu.Unlock()
	delta.mu.RLock()
	defer delta.mu.RUnlock()
	var sortRequired bool
	for k, v := range delta.m {
		if m.m[k] == nil {
			sortRequired = true
			m.keys = append(m.keys, k)
			m.m[k] = v
			continue
		}
		m.m[k].Add(v)
	}
	if sortRequired {
		sort.Strings(m.keys)
	}
	return nil
}
// Add adds a value (type Value) to the receiver Map. A non-Map value returns an error.
// This is part of the Value interface.
Add adds a value (type Value) to the receiver Map. A non-Map value returns an error.
This is part of the Value interface.
// Add adds a value ( type Value ) to the receiver Map . A non - Map value returns an error . // This is part of the Value interface .
func (m *Map) Add(val Value) error {
	delta, ok := val.(*Map)
	if !ok {
		return errors.New("incompatible value to add")
	}
	m.mu.Lock()
	defer m.mu.Unlock()
	delta.mu.RLock()
	defer delta.mu.RUnlock()
	var sortRequired bool
	for k, v := range delta.m {
		if m.m[k] == nil {
			sortRequired = true
			m.keys = append(m.keys, k)
			m.m[k] = v
			continue
		}
		m.m[k].Add(v)
	}
	if sortRequired {
		sort.Strings(m.keys)
	}
	return nil
}
func ( m * Map ) Add ( val Value ) error { delta , ok := val . ( * Map ) if ! ok { return errors . New ( " " ) } m . mu . Lock ( ) defer m . mu . Unlock ( ) delta . mu . RLock ( ) defer delta . mu . RUnlock ( ) var sortRequired bool for k , v := range delta . m { if m . m [ k ] == nil { sortRequired = true m . keys = append ( m . keys , k ) m . m [ k ] = v continue } m . m [ k ] . Add ( v ) } if sortRequired { sort . Strings ( m . keys ) } return nil }
Add adds a value (type Value) to the receiver Map.
Add adds a value ( type Value ) to the receiver Map .