Return the index of the added element
This commit is contained in:
@@ -21,9 +21,9 @@ func NewPerson(name string) *Person {
|
||||
}
|
||||
}
|
||||
|
||||
// AddExtension adds the Extension to the Person.
|
||||
func (p *Person) AddExtension(e *ExtensionElement) {
|
||||
addToSlice(&p.Extensions, e)
|
||||
// AddExtension adds the Extension to the Person. It returns an int.
|
||||
func (p *Person) AddExtension(e *ExtensionElement) int {
|
||||
return addToSlice(&p.Extensions, e)
|
||||
}
|
||||
|
||||
// DeleteExtension deletes the Extension at index from the Person. It return an
|
||||
|
Reference in New Issue
Block a user