From 8d30bfca56f487d6edad66c07d25abd436b3899f Mon Sep 17 00:00:00 2001 From: Teodor Calin Date: Wed, 27 May 2026 19:19:58 -0700 Subject: [PATCH] tests: tighten coverage by retiring unreachable defensive code Drop the post-NewClient nil guard in startClientLocked. NewClient returns nil only when url == "", and that case is already short-circuited at the top of startClientLocked, so the guard is unreachable. Coverage 99.4% -> 100%. --- service.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/service.go b/service.go index a1f2b1f..7923228 100644 --- a/service.go +++ b/service.go @@ -128,10 +128,9 @@ func (s *Service) startClientLocked(url string) { } return s.deps.Identity.NodeID() } + // NewClient returns nil only when url == "", which is already + // short-circuited above; no defensive nil check needed here. s.client = NewClient(url, nodeID, s.opts...) - if s.client == nil { - return - } ch, cancel := s.deps.Events.Subscribe("*") s.cancel = cancel done := make(chan struct{})