File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,17 +9,15 @@ const (
99 dataFile = "data/data.json"
1010)
1111
12- type (
13- // Feed contains information about an rss feed.
14- Feed struct {
15- Name string `json:"site"`
16- Uri string `json:"link"`
17- Type string `json:"type"`
18- }
19- )
12+ // Feed contains information about an rss feed.
13+ type Feed struct {
14+ Name string `json:"site"`
15+ Uri string `json:"link"`
16+ Type string `json:"type"`
17+ }
2018
2119// Load retrieves and unmarshals the data for the program.
22- func Load () ([]* Feed , error ) {
20+ func Load () ([]Feed , error ) {
2321 // Open the file.
2422 file , err := os .Open (dataFile )
2523 if err != nil {
@@ -31,7 +29,7 @@ func Load() ([]*Feed, error) {
3129 defer file .Close ()
3230
3331 // Decode the file into a slice of feed values.
34- var feeds []* Feed
32+ var feeds []Feed
3533 err = json .NewDecoder (file ).Decode (& feeds )
3634 if err != nil {
3735 return nil , err
Original file line number Diff line number Diff line change 77
88// NewMatcher is a factory that creates matcher values based
99// on the type of feed specified.
10- func NewMatcher (feed * Feed ) Matcher {
10+ func NewMatcher (feed Feed ) Matcher {
1111 // Create the right type of matcher for this search.
1212 switch feed .Type {
1313 case "rss" :
Original file line number Diff line number Diff line change 5353
5454// rssMatcher implements the Matcher interface.
5555type rssMatcher struct {
56- * Feed
56+ Feed
5757}
5858
5959// Match looks at the document for the specified search term.
You can’t perform that action at this time.
0 commit comments