Return the index of the added element
This commit is contained in:
@@ -17,9 +17,9 @@ func newCommonAttributes() *CommonAttributes {
|
||||
return new(CommonAttributes)
|
||||
}
|
||||
|
||||
// AddAttribute adds the attribute to the CommonAttributes.
|
||||
func (c *CommonAttributes) AddAttribute(name, value string) {
|
||||
addToSlice(&c.UndefinedAttributes, &xml.Attr{Name: xml.Name{Local: name}, Value: value})
|
||||
// AddAttribute adds the attribute to the CommonAttributes. It returns an int.
|
||||
func (c *CommonAttributes) AddAttribute(name, value string) int {
|
||||
return addToSlice(&c.UndefinedAttributes, &xml.Attr{Name: xml.Name{Local: name}, Value: value})
|
||||
}
|
||||
|
||||
// DeleteAttribute deletes the attribute at index from the CommonAttributes. It
|
||||
|
Reference in New Issue
Block a user