Make comments more useful

This commit is contained in:
2025-01-24 23:06:32 +01:00
parent be79a13d48
commit 9ab48787d4
23 changed files with 115 additions and 93 deletions

View File

@@ -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 {