@@ -257,9 +257,8 @@ func (t *DefaultRSSTranslator) translateFeedGenerator(rss *rss.Feed) (generator
257257}
258258
259259func (t * DefaultRSSTranslator ) translateFeedCategories (rss * rss.Feed ) (categories []string ) {
260- var cats []string
260+ cats := []string {}
261261 if rss .Categories != nil {
262- cats = make ([]string , 0 , len (rss .Categories ))
263262 for _ , c := range rss .Categories {
264263 cats = append (cats , c .Value )
265264 }
@@ -291,7 +290,7 @@ func (t *DefaultRSSTranslator) translateFeedCategories(rss *rss.Feed) (categorie
291290}
292291
293292func (t * DefaultRSSTranslator ) translateFeedItems (rss * rss.Feed ) (items []* Item ) {
294- items = make ( []* Item , 0 , len ( rss . Items ))
293+ items = []* Item {}
295294 for _ , i := range rss .Items {
296295 items = append (items , t .translateFeedItem (i ))
297296 }
@@ -458,9 +457,8 @@ func firstImageFromHtmlDocument(document string) *Image {
458457}
459458
460459func (t * DefaultRSSTranslator ) translateItemCategories (rssItem * rss.Item ) (categories []string ) {
461- var cats []string
460+ cats := []string {}
462461 if rssItem .Categories != nil {
463- cats = make ([]string , 0 , len (rssItem .Categories ))
464462 for _ , c := range rssItem .Categories {
465463 cats = append (cats , c .Value )
466464 }
@@ -641,7 +639,7 @@ func (t *DefaultAtomTranslator) translateFeedAuthor(atom *atom.Feed) (author *Pe
641639
642640func (t * DefaultAtomTranslator ) translateFeedAuthors (atom * atom.Feed ) (authors []* Person ) {
643641 if atom .Authors != nil {
644- authors = make ( []* Person , 0 , len ( atom . Authors ))
642+ authors = []* Person {}
645643
646644 for _ , a := range atom .Authors {
647645 authors = append (authors , & Person {
@@ -693,7 +691,7 @@ func (t *DefaultAtomTranslator) translateFeedGenerator(atom *atom.Feed) (generat
693691
694692func (t * DefaultAtomTranslator ) translateFeedCategories (atom * atom.Feed ) (categories []string ) {
695693 if atom .Categories != nil {
696- categories = make ( []string , 0 , len ( atom . Categories ))
694+ categories = []string {}
697695 for _ , c := range atom .Categories {
698696 if c .Label != "" {
699697 categories = append (categories , c .Label )
@@ -706,7 +704,7 @@ func (t *DefaultAtomTranslator) translateFeedCategories(atom *atom.Feed) (catego
706704}
707705
708706func (t * DefaultAtomTranslator ) translateFeedItems (atom * atom.Feed ) (items []* Item ) {
709- items = make ( []* Item , 0 , len ( atom . Entries ))
707+ items = []* Item {}
710708 for _ , entry := range atom .Entries {
711709 items = append (items , t .translateFeedItem (entry ))
712710 }
@@ -781,7 +779,7 @@ func (t *DefaultAtomTranslator) translateItemAuthor(entry *atom.Entry) (author *
781779
782780func (t * DefaultAtomTranslator ) translateItemAuthors (entry * atom.Entry ) (authors []* Person ) {
783781 if entry .Authors != nil {
784- authors = make ( []* Person , 0 , len ( entry . Authors ))
782+ authors = []* Person {}
785783 for _ , a := range entry .Authors {
786784 authors = append (authors , & Person {
787785 Name : a .Name ,
@@ -802,7 +800,7 @@ func (t *DefaultAtomTranslator) translateItemImage(entry *atom.Entry) (image *Im
802800
803801func (t * DefaultAtomTranslator ) translateItemCategories (entry * atom.Entry ) (categories []string ) {
804802 if entry .Categories != nil {
805- categories = make ( []string , 0 , len ( entry . Categories ))
803+ categories = []string {}
806804 for _ , c := range entry .Categories {
807805 if c .Label != "" {
808806 categories = append (categories , c .Label )
@@ -816,7 +814,7 @@ func (t *DefaultAtomTranslator) translateItemCategories(entry *atom.Entry) (cate
816814
817815func (t * DefaultAtomTranslator ) translateItemEnclosures (entry * atom.Entry ) (enclosures []* Enclosure ) {
818816 if entry .Links != nil {
819- enclosures = make ( []* Enclosure , 0 , len ( entry . Links ))
817+ enclosures = []* Enclosure {}
820818 for _ , e := range entry .Links {
821819 if e .Rel == "enclosure" {
822820 enclosure := & Enclosure {}
@@ -1003,7 +1001,7 @@ func (t *DefaultJSONTranslator) translateFeedAuthor(json *json.Feed) (author *Pe
10031001
10041002func (t * DefaultJSONTranslator ) translateFeedAuthors (json * json.Feed ) (authors []* Person ) {
10051003 if json .Authors != nil {
1006- authors = make ( []* Person , 0 , len ( json . Authors ))
1004+ authors = []* Person {}
10071005 for _ , a := range json .Authors {
10081006 name , address := shared .ParseNameAddress (a .Name )
10091007 author := & Person {}
@@ -1036,7 +1034,7 @@ func (t *DefaultJSONTranslator) translateFeedImage(json *json.Feed) (image *Imag
10361034}
10371035
10381036func (t * DefaultJSONTranslator ) translateFeedItems (json * json.Feed ) (items []* Item ) {
1039- items = make ( []* Item , 0 , len ( json . Items ))
1037+ items = []* Item {}
10401038 for _ , i := range json .Items {
10411039 items = append (items , t .translateFeedItem (i ))
10421040 }
@@ -1128,7 +1126,7 @@ func (t *DefaultJSONTranslator) translateItemAuthor(jsonItem *json.Item) (author
11281126
11291127func (t * DefaultJSONTranslator ) translateItemAuthors (jsonItem * json.Item ) (authors []* Person ) {
11301128 if jsonItem .Authors != nil {
1131- authors = make ( []* Person , 0 , len ( jsonItem . Authors ))
1129+ authors = []* Person {}
11321130 for _ , a := range jsonItem .Authors {
11331131 name , address := shared .ParseNameAddress (a .Name )
11341132 author := & Person {}
0 commit comments