Clarified Add method's comments
This commit is contained in:
14
entry.go
14
entry.go
@@ -66,7 +66,8 @@ func NewEntry(title string) *Entry {
|
||||
}
|
||||
}
|
||||
|
||||
// AddAuthor adds the Person as an author to the Entry. It returns an int.
|
||||
// AddAuthor adds the Person as an author to the Entry. It returns its index as
|
||||
// an int.
|
||||
func (e *Entry) AddAuthor(p *Person) int {
|
||||
e.Updated = NewDate(time.Now())
|
||||
return addToSlice(&e.Authors, p)
|
||||
@@ -82,7 +83,7 @@ func (e *Entry) DeleteAuthor(index int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddCategory adds the Category to the Entry. It returns an int.
|
||||
// AddCategory adds the Category to the Entry. It returns ts index as an int.
|
||||
func (e *Entry) AddCategory(c *Category) int {
|
||||
e.Updated = NewDate(time.Now())
|
||||
return addToSlice(&e.Categories, c)
|
||||
@@ -99,8 +100,8 @@ func (e *Entry) DeleteCategory(index int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddContributor adds the Person as a contributor to the Entry. It returns an
|
||||
// int.
|
||||
// AddContributor adds the Person as a contributor to the Entry. It returns its
|
||||
// index as an int.
|
||||
func (e *Entry) AddContributor(c *Person) int {
|
||||
e.Updated = NewDate(time.Now())
|
||||
return addToSlice(&e.Contributors, c)
|
||||
@@ -117,7 +118,7 @@ func (e *Entry) DeleteContributor(index int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddLink adds the Link to the Entry. It returns an int.
|
||||
// AddLink adds the Link to the Entry. It returns its index as an int.
|
||||
func (e *Entry) AddLink(l *Link) int {
|
||||
e.Updated = NewDate(time.Now())
|
||||
return addToSlice(&e.Links, l)
|
||||
@@ -133,7 +134,8 @@ func (e *Entry) DeleteLink(index int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddExtension adds the ExtensionElement to the Entry. It returns an int.
|
||||
// AddExtension adds the ExtensionElement to the Entry. It returns its index as
|
||||
// an int.
|
||||
func (e *Entry) AddExtension(x *ExtensionElement) int {
|
||||
e.Updated = NewDate(time.Now())
|
||||
return addToSlice(&e.Extensions, x)
|
||||
|
Reference in New Issue
Block a user