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)
| 415 | // to receive any error that might have occured during the attributes |
| 416 | // decoding |
| 417 | func (attributes Attributes) Put(key string, value interface{}, errorHolder *error) Attributes { |
| 418 | rawJSON, err := json.Marshal(value) |
| 419 | if err != nil && errorHolder != nil { |
| 420 | *errorHolder = err |
| 421 | } |
| 422 | |
| 423 | attributes[key] = apiext.JSON{ |
| 424 | Raw: rawJSON, |
| 425 | } |
| 426 | return attributes |
| 427 | } |
| 428 | |
| 429 | // FromMap allows adding into the current map of attributes all |
| 430 | // the attributes contained in the given map of interfaces |
no outgoing calls
no test coverage detected