Changed comments a bit

This commit is contained in:
2024-10-20 12:41:09 +02:00
parent bcf2532372
commit 764b143ff8
5 changed files with 29 additions and 19 deletions

View File

@@ -33,7 +33,7 @@ func (s *Source) AddAuthor(p *Person) {
addToSlice(&s.Authors, p)
}
// DeleteAuthor deletes the Person from the Source. It return an error.
// DeleteAuthor deletes the Person at index from the Source. It return an error.
func (s *Source) DeleteAuthor(index int) error {
if err := deleteFromSlice(&s.Authors, index); err != nil {
return fmt.Errorf("error deleting author %v from source %v: %v", index, s, err)
@@ -46,7 +46,8 @@ func (s *Source) AddCategory(c *Category) {
addToSlice(&s.Categories, c)
}
// DeleteCategory deletes the Category from the Source. It return an error.
// DeleteCategory deletes the Category at index from the Source. It return an
// error.
func (s *Source) DeleteCategory(index int) error {
if err := deleteFromSlice(&s.Categories, index); err != nil {
return fmt.Errorf("error deleting category %v from source %v: %v", index, s, err)
@@ -59,7 +60,8 @@ func (s *Source) AddContributor(c *Person) {
addToSlice(&s.Contributors, c)
}
// DeleteContributor deletes the Person from the Source. It return an error.
// DeleteContributor deletes the Person at index from the Source. It return an
// error.
func (s *Source) DeleteContributor(index int) error {
if err := deleteFromSlice(&s.Contributors, index); err != nil {
return fmt.Errorf("error deleting contributor %v from source %v: %v", index, s, err)
@@ -72,7 +74,7 @@ func (s *Source) AddLink(l *Link) {
addToSlice(&s.Links, l)
}
// DeleteLink deletes the Link from the Source. It return an error.
// DeleteLink deletes the Link at index from the Source. It return an error.
func (s *Source) DeleteLink(index int) error {
if err := deleteFromSlice(&s.Links, index); err != nil {
return fmt.Errorf("error deleting link %v from source %v: %v", index, s, err)
@@ -85,7 +87,8 @@ func (s *Source) AddExtension(e *ExtensionElement) {
addToSlice(&s.Extensions, e)
}
// DeleteExtension deletes the Extension from the Source. It return an error.
// DeleteExtension deletes the Extension at index from the Source. It return an
// error.
func (s *Source) DeleteExtension(index int) error {
if err := deleteFromSlice(&s.Extensions, index); err != nil {
return fmt.Errorf("error deleting extension %v from source %v: %v", index, s, err)