Skip to content

Commit 8931c8f

Browse files
Fix comments.
1 parent 6b37e73 commit 8931c8f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/chapter2/search/data/data.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ type (
2020

2121
// Load retrieves and unmarshals the data for the program.
2222
func Load() ([]Feed, error) {
23-
// Read the entire file.
23+
// Open the file.
2424
file, err := os.Open(dataFile)
2525
if err != nil {
2626
return nil, err
2727
}
2828

29+
// Schedule the file to be closed once
30+
// the function returns.
2931
defer file.Close()
3032

31-
// Unmarshal the json document into a slice of feeds.
33+
// Decode the file into a slice of feed values.
3234
var feeds []Feed
3335
err = json.NewDecoder(file).Decode(&feeds)
3436
if err != nil {

0 commit comments

Comments
 (0)