Make comments more useful
This commit is contained in:
@@ -17,14 +17,14 @@ func NewCommonAttributes() *CommonAttributes {
|
||||
return new(CommonAttributes)
|
||||
}
|
||||
|
||||
// AddAttribute adds the attribute to the CommonAttributes. It returns its index
|
||||
// as an int.
|
||||
// AddAttribute adds an attribute to the CommonAttributes. It takes in the
|
||||
// strings name and value and returns the index as 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
|
||||
// return an error.
|
||||
// returns an error.
|
||||
func (c *CommonAttributes) DeleteAttribute(index int) error {
|
||||
if err := deleteFromSlice(&c.UndefinedAttributes, index); err != nil {
|
||||
return fmt.Errorf("error deleting undefined attribute %v from common attributes %v: %v", index, c, err)
|
||||
|
Reference in New Issue
Block a user