MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / mergeMetadata

Function mergeMetadata

metadata.go:185–195  ·  view source on GitHub ↗

mergeMetadata merges new metadata with existing metadata. If the current metadata is nil, it initializes a new map. Parameters: - current: The existing metadata map. - new: The new metadata map to merge. Returns: - map[string]interface{}: The merged metadata map.

(current, new map[string]interface{})

Source from the content-addressed store, hash-verified

183// Returns:
184// - map[string]interface{}: The merged metadata map.
185func mergeMetadata(current, new map[string]interface{}) map[string]interface{} {
186 if current == nil {
187 current = make(map[string]interface{})
188 }
189
190 for k, v := range new {
191 current[k] = v
192 }
193
194 return current
195}
196
197// updateEntityMetadata updates the metadata for a specific entity.
198// It routes the update operation to the appropriate datasource method based on the entity type.

Callers 2

UpdateMetadataMethod · 0.85
TestMergeMetadataFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestMergeMetadataFunction · 0.68