Turn updateDateTime into *Date.Update
This commit is contained in:
20
entry.go
20
entry.go
@@ -69,7 +69,7 @@ func NewEntry(title string) *Entry {
|
||||
// AddAuthor adds the Person as an author to the Entry. It returns its index as
|
||||
// an int.
|
||||
func (e *Entry) AddAuthor(p *Person) int {
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return addToSlice(&e.Authors, p)
|
||||
}
|
||||
|
||||
@@ -79,13 +79,13 @@ func (e *Entry) DeleteAuthor(index int) error {
|
||||
return fmt.Errorf("error deleting author %v from entry %v: %v", index, e.ID.URI, err)
|
||||
}
|
||||
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddCategory adds the Category to the Entry. It returns ts index as an int.
|
||||
func (e *Entry) AddCategory(c *Category) int {
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return addToSlice(&e.Categories, c)
|
||||
}
|
||||
|
||||
@@ -96,14 +96,14 @@ func (e *Entry) DeleteCategory(index int) error {
|
||||
return fmt.Errorf("error deleting category %v from entry %v: %v", index, e.ID.URI, err)
|
||||
}
|
||||
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddContributor adds the Person as a contributor to the Entry. It returns its
|
||||
// index as an int.
|
||||
func (e *Entry) AddContributor(c *Person) int {
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return addToSlice(&e.Contributors, c)
|
||||
}
|
||||
|
||||
@@ -114,13 +114,13 @@ func (e *Entry) DeleteContributor(index int) error {
|
||||
return fmt.Errorf("error deleting contributor %v from entry %v: %v", index, e.ID.URI, err)
|
||||
}
|
||||
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddLink adds the Link to the Entry. It returns its index as an int.
|
||||
func (e *Entry) AddLink(l *Link) int {
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return addToSlice(&e.Links, l)
|
||||
}
|
||||
|
||||
@@ -130,14 +130,14 @@ func (e *Entry) DeleteLink(index int) error {
|
||||
return fmt.Errorf("error deleting link %v from entry %v: %v", index, e.ID.URI, err)
|
||||
}
|
||||
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddExtension adds the ExtensionElement to the Entry. It returns its index as
|
||||
// an int.
|
||||
func (e *Entry) AddExtension(x *ExtensionElement) int {
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return addToSlice(&e.Extensions, x)
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ func (e *Entry) DeleteExtension(index int) error {
|
||||
return fmt.Errorf("error deleting extension %v from entry %v: %v", index, e.ID.URI, err)
|
||||
}
|
||||
|
||||
updateDateTime(e.Updated)
|
||||
e.Updated.Update()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user