Clarified Add method's comments

This commit is contained in:
2024-10-20 14:31:54 +02:00
parent 8ce7d54d00
commit ae24db0c08
5 changed files with 28 additions and 21 deletions

15
feed.go
View File

@@ -35,7 +35,8 @@ func NewFeed(title string) *Feed {
}
}
// AddAuthor adds the Person as an author to the Feed. It returns an int.
// AddAuthor adds the Person as an author to the Feed. It returns its index as
// an int.
func (f *Feed) AddAuthor(p *Person) int {
f.Updated = NewDate(time.Now())
return addToSlice(&f.Authors, p)
@@ -51,7 +52,7 @@ func (f *Feed) DeleteAuthor(index int) error {
return nil
}
// AddCategory adds the Category to the Feed. It returns an int.
// AddCategory adds the Category to the Feed. It returns its index as an int.
func (f *Feed) AddCategory(c *Category) int {
f.Updated = NewDate(time.Now())
return addToSlice(&f.Categories, c)
@@ -68,8 +69,8 @@ func (f *Feed) DeleteCategory(index int) error {
return nil
}
// AddContributor adds the Person as a contributor to the Feed. It returns an
// int.
// AddContributor adds the Person as a contributor to the Feed. It returns its
// index as an int.
func (f *Feed) AddContributor(c *Person) int {
f.Updated = NewDate(time.Now())
return addToSlice(&f.Contributors, c)
@@ -87,7 +88,7 @@ func (f *Feed) DeleteContributor(index int) error {
}
// AddLink adds the Link to the Feed. There should be one Link with Rel "self".
// It returns an int.
// It returns its index as an int.
func (f *Feed) AddLink(l *Link) int {
f.Updated = NewDate(time.Now())
return addToSlice(&f.Links, l)
@@ -103,7 +104,7 @@ func (f *Feed) DeleteLink(index int) error {
return nil
}
// AddExtension adds the Extension to the Feed. It returns an int.
// AddExtension adds the Extension to the Feed. It returns its index as an int.
func (f *Feed) AddExtension(e *ExtensionElement) int {
f.Updated = NewDate(time.Now())
return addToSlice(&f.Extensions, e)
@@ -120,7 +121,7 @@ func (f *Feed) DeleteExtension(index int) error {
return nil
}
// AddEntry adds the Entry to the Feed. It returns an int.
// AddEntry adds the Entry to the Feed. It returns its index as an int.
func (f *Feed) AddEntry(e *Entry) int {
f.Updated = NewDate(time.Now())
return addToSlice(&f.Entries, e)