MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / Put

Method Put

apis/controller/v1alpha1/attributes.go:408–418  ·  view source on GitHub ↗

Put allows adding an attribute to the current map of attributes. The attribute 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 error that might have occured during the attributes decoding

(key string, value interface{}, errorHolder *error)

Source from the content-addressed store, hash-verified

406// to receive any error that might have occured during the attributes
407// decoding
408func (attributes Attributes) Put(key string, value interface{}, errorHolder *error) Attributes {
409 rawJSON, err := json.Marshal(value)
410 if err != nil && errorHolder != nil {
411 *errorHolder = err
412 }
413
414 attributes[key] = apiext.JSON{
415 Raw: rawJSON,
416 }
417 return attributes
418}
419
420// FromMap allows adding into the current map of attributes all
421// the attributes contained in the given map of interfaces

Callers 3

TestMergeExternalConfigFunction · 0.95
FromMapMethod · 0.95

Calls

no outgoing calls

Tested by 2

TestMergeExternalConfigFunction · 0.76