From ccbbff4774c57c77f66ea64351f7f46bd0db2d9f Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Mon, 22 Nov 2021 23:25:01 +0100 Subject: Increase go-conformity: map[T]struct{} instead of map[T]bool for sets --- internal/feed/cache/state.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/feed/cache/state.go') diff --git a/internal/feed/cache/state.go b/internal/feed/cache/state.go index ce6723a..dfdefa1 100644 --- a/internal/feed/cache/state.go +++ b/internal/feed/cache/state.go @@ -11,7 +11,7 @@ import ( type State struct { feeds map[string]*feed.Feed cachedFeeds map[string]CachedFeed - knownFeeds map[feed.Descriptor]bool + knownFeeds map[feed.Descriptor]struct{} cache Cache cfg *config.Config } @@ -56,7 +56,7 @@ func (state *State) LoadCache(fileName string, forceNew bool) error { for name, feed := range state.feeds { state.cachedFeeds[name] = cache.cachedFeed(feed) - state.knownFeeds[feed.Descriptor()] = true + state.knownFeeds[feed.Descriptor()] = struct{}{} } // state.feeds should not be used after loading the cache --> enforce a panic @@ -122,7 +122,7 @@ func NewState(cfg *config.Config) (*State, error) { state := State{ feeds: make(map[string]*feed.Feed, numFeeds), cachedFeeds: make(map[string]CachedFeed, numFeeds), - knownFeeds: make(map[feed.Descriptor]bool, numFeeds), + knownFeeds: make(map[feed.Descriptor]struct{}, numFeeds), cache: Cache{}, // loaded later on cfg: cfg, } -- cgit v1.2.3-70-g09d2