From b922401b5db401dacd72a65d4e591ce43d67cf21 Mon Sep 17 00:00:00 2001 From: Snider Date: Thu, 30 Apr 2026 18:03:09 +0100 Subject: [PATCH] refactor(go): use core.Ok(nil) instead of core.Result{OK: true} (Mantis #1243) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrate two `core.Result{OK: true}` literals to `core.Ok(nil)` — the canonical core/go primitive. Result struct literals are an audit-tracked gaming dimension (result-literals) — Ok/Fail/ResultOf are the constructor contract. Sites: - go/service.go OnStartup result - go/pkg/api/provider.go ProcessProvider event-action result Also auto-formatted indentation on a switch case in service.go. 0 gaming patterns. Build, vet, test all clean. Closes tasks.lthn.sh/view.php?id=1243 Co-authored-by: Codex --- go/pkg/api/provider.go | 2 +- go/service.go | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go/pkg/api/provider.go b/go/pkg/api/provider.go index 0c422f5..ee6faa7 100644 --- a/go/pkg/api/provider.go +++ b/go/pkg/api/provider.go @@ -720,7 +720,7 @@ func (p *ProcessProvider) registerProcessEvents() { p.actions.Do(func() { coreApp.RegisterAction(func(_ *core.Core, msg core.Message) core.Result { p.forwardProcessEvent(msg) - return core.Result{OK: true} + return core.Ok(nil) }) }) } diff --git a/go/service.go b/go/service.go index 26a84db..cbacbb0 100644 --- a/go/service.go +++ b/go/service.go @@ -96,7 +96,7 @@ func (s *Service) OnStartup(context.Context) core.Result { c.RegisterAction(s.handleTask) } }) - return core.Result{OK: true} + return core.Ok(nil) } // OnShutdown implements core.Stoppable. @@ -822,12 +822,12 @@ func (s *Service) handleTask(c *core.Core, task core.Message) core.Result { } proc := result.Value.(*Process) return core.Ok(proc.Info()) - case TaskProcessRun: - result := s.RunWithOptions(c.Context(), RunOptions(m)) - if !result.OK { - return result - } - return core.Ok(result.Value) + case TaskProcessRun: + result := s.RunWithOptions(c.Context(), RunOptions(m)) + if !result.OK { + return result + } + return core.Ok(result.Value) case TaskProcessKill: switch { case m.ID != "":