Stop abusing pointers for Atom generation
This commit is contained in:
parent
672c6e67ec
commit
4d0ce85b42
14
main.go
14
main.go
|
@ -314,9 +314,9 @@ func main() {
|
|||
}
|
||||
gemini.ParseLines(resp.Body, aw.Handle)
|
||||
sort.Sort(ByTime(aw.Items))
|
||||
feed := &Feed{
|
||||
feed := Feed{
|
||||
XMLNS: "http://www.w3.org/2005/Atom",
|
||||
Link: &FeedLink{
|
||||
Link: FeedLink{
|
||||
Href: req.URL.String(),
|
||||
},
|
||||
Id: req.URL.String(),
|
||||
|
@ -338,9 +338,9 @@ func main() {
|
|||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
feed.Entries = append(feed.Entries, &FeedEntry{
|
||||
feed.Entries = append(feed.Entries, FeedEntry{
|
||||
Title: item.Title,
|
||||
Link: &EntryLink{
|
||||
Link: EntryLink{
|
||||
Href: link.String(),
|
||||
Rel: "alternate",
|
||||
},
|
||||
|
@ -359,10 +359,10 @@ type Feed struct {
|
|||
XMLName xml.Name `xml:"feed"`
|
||||
XMLNS string `xml:"xmlns,attr"`
|
||||
Title string `xml:"title"`
|
||||
Link *FeedLink `xml:"link"`
|
||||
Link FeedLink `xml:"link"`
|
||||
Updated string `xml:"updated"`
|
||||
Id string `xml:"id"`
|
||||
Entries []*FeedEntry `xml:"entry"`
|
||||
Entries []FeedEntry `xml:"entry"`
|
||||
}
|
||||
type FeedLink struct {
|
||||
XMLName xml.Name `xml:"link"`
|
||||
|
@ -371,7 +371,7 @@ type FeedLink struct {
|
|||
type FeedEntry struct {
|
||||
XMLName xml.Name `xml:"entry"`
|
||||
Title string `xml:"title"`
|
||||
Link *EntryLink `xml:"link"`
|
||||
Link EntryLink `xml:"link"`
|
||||
Id string `xml:"id"`
|
||||
Updated string `xml:"updated"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue