summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/core.go1
-rw-r--r--core/structs.go10
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()
}