From 11160bc62b08fd6e984d38d5600fa62c3564668f Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Tue, 11 Jun 2024 13:36:56 +0300 Subject: [PATCH] all: imp docs --- internal/client/persistent.go | 3 ++- internal/home/clientshttp.go | 2 +- internal/home/clientshttp_internal_test.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/client/persistent.go b/internal/client/persistent.go index 317dc72b..52f3aacc 100644 --- a/internal/client/persistent.go +++ b/internal/client/persistent.go @@ -66,7 +66,8 @@ type Persistent struct { SafeSearch filtering.SafeSearch - // BlockedServices is the configuration of blocked services of a client. + // BlockedServices is the configuration of blocked services of a client. It + // must not be nil after initialization. BlockedServices *filtering.BlockedServices Name string diff --git a/internal/home/clientshttp.go b/internal/home/clientshttp.go index 40a91f86..fbec5c23 100644 --- a/internal/home/clientshttp.go +++ b/internal/home/clientshttp.go @@ -267,7 +267,7 @@ func copyBlockedServices( var weekly *schedule.Weekly if sch != nil { weekly = sch.Clone() - } else if prev != nil && prev.BlockedServices != nil { + } else if prev != nil { weekly = prev.BlockedServices.Schedule.Clone() } else { weekly = schedule.EmptyWeekly() diff --git a/internal/home/clientshttp_internal_test.go b/internal/home/clientshttp_internal_test.go index dc1aa87d..aa2f40fb 100644 --- a/internal/home/clientshttp_internal_test.go +++ b/internal/home/clientshttp_internal_test.go @@ -49,7 +49,7 @@ func newPersistentClient(name string) (c *client.Persistent) { Name: name, UID: client.MustNewUID(), BlockedServices: &filtering.BlockedServices{ - Schedule: &schedule.Weekly{}, + Schedule: schedule.EmptyWeekly(), }, } }