From 3b26eb986350587f8330ef126c63a542b5c3f8ce Mon Sep 17 00:00:00 2001 From: nytpu Date: Thu, 18 Mar 2021 10:32:10 -0600 Subject: [PATCH] fix several typos throughout core --- core/core.go | 1 + core/structs.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/core/core.go b/core/core.go index 7a3dd40..70f9cb7 100644 --- a/core/core.go +++ b/core/core.go @@ -60,4 +60,5 @@ func Init(dataPath string) error { if Data.Pages == nil { Data.Pages = make(map[url.URL]*Page) } + return nil } diff --git a/core/structs.go b/core/structs.go index 28915e1..3162877 100644 --- a/core/structs.go +++ b/core/structs.go @@ -99,7 +99,7 @@ func (f *Feed) Len() int { // Less compares Published of Items[i], Items[k] and returns true if Items[i] is // before Items[j]. -func (f *Feed) Less(i, j int) { +func (f *Feed) Less(i, j int) bool { return f.Items[i].Published.Before(f.Items[j].Published) } @@ -109,25 +109,25 @@ func (f *Feed) Swap(i, j int) { } // Lock locks both feed and page mutexes. -func (j *JsonData) Lock() { +func (j *FullData) Lock() { j.FeedsMu.Lock() j.PagesMu.Lock() } // Unlock unlocks both feed and page mutexes. -func (j *JsonData) Unlock() { +func (j *FullData) Unlock() { j.FeedsMu.Unlock() j.PagesMu.Unlock() } // RLock read-locks both feed and page mutexes. -func (j *JsonData) RLock() { +func (j *FullData) RLock() { j.FeedsMu.RLock() j.PagesMu.RLock() } // RUnlock read-unlocks both feed and page mutexes. -func (j *JsonData) RUnlock() { +func (j *FullData) RUnlock() { j.FeedsMu.RUnlock() j.PagesMu.RUnlock() }