File tree Expand file tree Collapse file tree 1 file changed +22
-16
lines changed Expand file tree Collapse file tree 1 file changed +22
-16
lines changed Original file line number Diff line number Diff line change 1
1
## gorilla/feeds
2
+ ![ GoDoc] ( https://godoc.org/github.com/gorilla/feeds?status.svg )] ( https://godoc.org/github.com/gorilla/feeds ) [ ![ Build Status] ( https://travis-ci.org/gorilla/feeds.png?branch=master )] ( https://travis-ci.org/gorilla/feeds )
2
3
3
- Web feed generator library.
4
-
5
- [ ![ Build Status] ( https://travis-ci.org/gorilla/feeds.png?branch=master )] ( https://travis-ci.org/gorilla/feeds )
4
+ feeds is a web feed generator library for generating RSS and Atom feeds from Go
5
+ applications.
6
6
7
7
### Goals
8
8
9
- * simple interface to create both Atom & RSS 2.0 feeds
10
- * full support for Atom/ RSS2.0 spec elements
11
- * ability to modify particulars for each spec
9
+ * Provide a simple interface to create both Atom & RSS 2.0 feeds
10
+ * Full support for Atom and RSS2.0 spec elements
11
+ * Ability to modify particulars for each spec
12
12
13
13
### Usage
14
14
15
15
``` go
16
+ package main
16
17
17
- package main {
18
-
19
- import (
20
- " fmt"
21
- " time"
22
- " github.com/gorilla/feeds"
23
- )
18
+ import (
19
+ " fmt"
20
+ " time"
21
+ " github.com/gorilla/feeds"
22
+ )
24
23
24
+ func main () {
25
25
now := time.Now ()
26
26
feed := &feeds.Feed {
27
27
Title: " jmoiron.net blog" ,
@@ -53,12 +53,18 @@ package main {
53
53
},
54
54
}
55
55
56
- atom , _ := feed.ToAtom () // _ parameter is err
57
- rss , _ := feed.ToRss () // _ parameter is err
56
+ atom , err := feed.ToAtom ()
57
+ if err != nil {
58
+ log.Fatal (err)
59
+ }
60
+
61
+ rss , err := feed.ToRss ()
62
+ if err != nil {
63
+ log.Fatal (err)
64
+ }
58
65
59
66
fmt.Println (atom, " \n " , rss)
60
67
}
61
-
62
68
```
63
69
64
70
Outputs:
You can’t perform that action at this time.
0 commit comments