Make comments more useful
This commit is contained in:
@@ -13,7 +13,8 @@ type Person struct {
|
||||
Extensions []*ExtensionElement `xml:",any,omitempty"`
|
||||
}
|
||||
|
||||
// NewPerson creates a new Person. It returns a *Person.
|
||||
// NewPerson creates a new Person. It takes in a string name and returns a
|
||||
// *Person.
|
||||
func NewPerson(name string) *Person {
|
||||
return &Person{
|
||||
CommonAttributes: NewCommonAttributes(),
|
||||
@@ -21,13 +22,13 @@ func NewPerson(name string) *Person {
|
||||
}
|
||||
}
|
||||
|
||||
// AddExtension adds the Extension to the Person. It returns its index as an
|
||||
// AddExtension adds the Extension e to the Person. It returns the index as 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
|
||||
// DeleteExtension deletes the Extension at index from the Person. It returns an
|
||||
// error.
|
||||
func (p *Person) DeleteExtension(index int) error {
|
||||
if err := deleteFromSlice(&p.Extensions, index); err != nil {
|
||||
|
Reference in New Issue
Block a user