MarshalJSON helps implement the json.Marshaler interface, thereby rendering the Attributes correctly when printing (via pretty.JSON) structs containing Attributes as fields. Is it impossible to unmarshal attributes from a JSON representation and this method is meant only for debugging purposes.
()
| 152 | // Is it impossible to unmarshal attributes from a JSON representation and this |
| 153 | // method is meant only for debugging purposes. |
| 154 | func (a *Attributes) MarshalJSON() ([]byte, error) { |
| 155 | return []byte(a.String()), nil |
| 156 | } |
| 157 | |
| 158 | // all returns an iterator that yields all key-value pairs in the Attributes |
| 159 | // chain. If a key appears multiple times, only the most recently added value |
no test coverage detected