diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2021-10-24 12:52:38 -0400 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2021-10-24 12:52:38 -0400 |
| commit | 268fcf7e6b671d4959a12111d5abf553bf0a201b (patch) | |
| tree | 6f5c46c9a765478eaae78d66f4b9aefc953bbd1a /page/checkup.go | |
| parent | d36b6a55c8fa4400cd39de717443e110e990a8a3 (diff) | |
| download | go-website-268fcf7e6b671d4959a12111d5abf553bf0a201b.tar.gz go-website-268fcf7e6b671d4959a12111d5abf553bf0a201b.tar.xz | |
Redis caching. Linter config and cleanup.
Diffstat (limited to 'page/checkup.go')
| -rw-r--r-- | page/checkup.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/page/checkup.go b/page/checkup.go index c4501c2..9f721b7 100644 --- a/page/checkup.go +++ b/page/checkup.go @@ -9,25 +9,25 @@ import ( ) // Checkup will return a map[string]PageList of all the pages broken down by -// the status of their fields. For instance, whehter or not they have a date +// the status of their fields. For instance, whehter or not they have a date. func (p *Page) Checkup() (map[string]PageList, error) { Logger.Println("Checking up on all files...") out := make(map[string]PageList) - filepath.Walk(filepath.Dir("."), + _ = filepath.Walk(filepath.Dir("."), func(path string, info os.FileInfo, err error) error { if err != nil { return err } if !info.IsDir() && strings.HasSuffix(info.Name(), Suffix) { - p2 := NewPage(strings.ReplaceAll(path, Suffix, "")) err = p2.Read() if err != nil { Logger.Println("Error encountered: ", err) + return err } @@ -73,9 +73,7 @@ func (p *Page) Checkup() (map[string]PageList, error) { } else { out[key] = append(out[key], p2) } - } - } return nil |
