type Attributes … // New returns a new Attributes containing the key/value pair. func New(key, value any) *Attributes { … } // WithValue returns a new Attributes containing the previous keys and values // and the new key/value pair. If the same key appears multiple times, the // last value overwrites all previous values for that key. To remove an // existing key, use a nil value. value should not be modified later. func (a *Attributes) WithValue(key, value any) *Attributes { … } // Value returns the value associated with these attributes for key, or nil if // no value is associated with key. The returned value should not be modified. func (a *Attributes) Value(key any) any { … } // Equal returns whether a and o are equivalent. If 'Equal(o any) bool' is // implemented for a value in the attributes, it is called to determine if the // value matches the one stored in the other attributes. If Equal is not // implemented, standard equality is used to determine if the two values are // equal. Note that some types (e.g. maps) aren't comparable by default, so // they must be wrapped in a struct, or in an alias type, with Equal defined. func (a *Attributes) Equal(o *Attributes) bool { … } // String prints the attribute map. If any key or values throughout the map // implement fmt.Stringer, it calls that method and appends. func (a *Attributes) String() string { … } func str(x any) (s string) { … } // 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. func (a *Attributes) MarshalJSON() ([]byte, error) { … }