Stop abusing pointers for Atom generation
This commit is contained in:
parent
672c6e67ec
commit
4d0ce85b42
16
main.go
16
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,14 +371,14 @@ 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"`
|
||||
}
|
||||
type EntryLink struct {
|
||||
XMLName xml.Name `xml:"link"`
|
||||
Href string `xml:"href,attr"`
|
||||
Rel string `xml:"rel,attr"`
|
||||
Rel string `xml:"rel,attr"`
|
||||
}
|
||||
|
||||
type FeedItem struct {
|
||||
|
|
Loading…
Reference in New Issue