Skip to content

Commit

Permalink
feat: add ability to set news name
Browse files Browse the repository at this point in the history
  • Loading branch information
mingard committed Nov 2, 2022
1 parent 546cf17 commit e601f37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
USER=mingard
PACKAGE=sitemap-format
VERSION=0.0.3
VERSION=1.0.1

# Go command variables
GOCMD=go
Expand Down
7 changes: 7 additions & 0 deletions news.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
// News stores news entry data.
type News struct {
XMLName xml.Name `xml:"news:news"`
Name string `xml:"news:name"`
Publication *Publication `xml:"news:publication"`
PublicationDate time.Time `xml:"news:publication_date"`
Title string `xml:"news:title"`
Expand All @@ -21,6 +22,12 @@ func (n *News) SetTitle(t string) *News {
return n
}

// SetName sets the news extensions name parameter.
func (n *News) SetName(na string) *News {
n.Name = na
return n
}

// SetPublicationDate sets the news extensions PublicationDate parameter.
func (n *News) SetPublicationDate(t time.Time) *News {
n.PublicationDate = t.UTC()
Expand Down

0 comments on commit e601f37

Please sign in to comment.