MCPcopy Create free account
hub / github.com/devfile/api / FromMap

Method FromMap

pkg/attributes/attributes.go:437–445  ·  view source on GitHub ↗

FromMap allows adding into the current map of attributes all the attributes contained in the given map of interfaces each attribute of the given map is provided as an interface, and can be any value that supports Json Marshaling. An optional error holder can be passed as an argument to receive any

(strings map[string]interface{}, errorHolder *error)

Source from the content-addressed store, hash-verified

435// to receive any error that might have occured during the attributes
436// decoding
437func (attributes Attributes) FromMap(strings map[string]interface{}, errorHolder *error) Attributes {
438 for key, value := range strings {
439 // Here only the last error is returned.
440 // Let's keep it simple and avoid adding a dependency
441 // on an external package just for gathering errors.
442 attributes.Put(key, value, errorHolder)
443 }
444 return attributes
445}
446
447// FromInterface allows completing the map of attributes from the given interface.
448// The given interface, and can be any value

Callers 2

attributes_test.goFile · 0.80

Calls 1

PutMethod · 0.95

Tested by 1