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

View File

@@ -28,7 +28,8 @@ func NewSource() *Source {
return &Source{CommonAttributes: newCommonAttributes()}
}
// AddAuthor adds the Person as an author to the Source. It returns an int.
// AddAuthor adds the Person as an author to the Source. It returns its index as
// an int.
func (s *Source) AddAuthor(p *Person) int {
return addToSlice(&s.Authors, p)
}
@@ -41,7 +42,7 @@ func (s *Source) DeleteAuthor(index int) error {
return nil
}
// AddCategory adds the Category to the Source. It returns an int.
// AddCategory adds the Category to the Source. It returns its index as an int.
func (s *Source) AddCategory(c *Category) int {
return addToSlice(&s.Categories, c)
}
@@ -55,8 +56,8 @@ func (s *Source) DeleteCategory(index int) error {
return nil
}
// AddContributor adds the Person as a contributor to the Source. It returns an
// int.
// AddContributor adds the Person as a contributor to the Source. It returns its
// index as an int.
func (s *Source) AddContributor(c *Person) int {
return addToSlice(&s.Contributors, c)
}
@@ -70,7 +71,7 @@ func (s *Source) DeleteContributor(index int) error {
return nil
}
// AddLink adds the Link to the Source. It returns an int.
// AddLink adds the Link to the Source. It returns its index as an int.
func (s *Source) AddLink(l *Link) int {
return addToSlice(&s.Links, l)
}
@@ -83,7 +84,8 @@ func (s *Source) DeleteLink(index int) error {
return nil
}
// AddExtension adds the ExtensionElement to the Source. It returns an int.
// AddExtension adds the ExtensionElement to the Source. It returns its index as
// an int.
func (s *Source) AddExtension(e *ExtensionElement) int {
return addToSlice(&s.Extensions, e)
}