From 0db2afef68f6ad06489628d0dc5369963d023828 Mon Sep 17 00:00:00 2001 From: dj-oyu <68707227+dj-oyu@users.noreply.github.com> Date: Thu, 5 Mar 2026 02:10:21 +0900 Subject: [PATCH] style: fix golangci-lint issues (whitespace, gofumpt, gci, golines) Co-Authored-By: Claude Opus 4.6 --- pkg/miniapp/api.go | 28 +++++++++++++++++++----- pkg/miniapp/miniapp_test.go | 1 + pkg/providers/anthropic/provider_test.go | 1 + 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pkg/miniapp/api.go b/pkg/miniapp/api.go index 01d88703f..95df367d7 100644 --- a/pkg/miniapp/api.go +++ b/pkg/miniapp/api.go @@ -230,9 +230,17 @@ func (h *Handler) apiEvents(w http.ResponseWriter, r *http.Request) { // Send initial state immediately sendSSEIfChanged(w, flusher, "plan", h.provider.GetPlanInfo(), &lastPlan) - sendSSEIfChanged(w, flusher, "session", - map[string]any{"stats": h.provider.GetSessionStats(), "sessions": h.provider.GetActiveSessions(), "graph": h.provider.GetSessionGraph()}, - &lastSession) + sendSSEIfChanged( + w, + flusher, + "session", + map[string]any{ + "stats": h.provider.GetSessionStats(), + "sessions": h.provider.GetActiveSessions(), + "graph": h.provider.GetSessionGraph(), + }, + &lastSession, + ) sendSSEIfChanged(w, flusher, "skills", h.provider.ListSkills(), &lastSkills) sendSSEIfChanged(w, flusher, "dev", h.devStatus(), &lastDev) sendSSEIfChanged(w, flusher, "context", h.provider.GetContextInfo(), &lastContext) @@ -246,9 +254,17 @@ func (h *Handler) apiEvents(w http.ResponseWriter, r *http.Request) { return case <-ch: sendSSEIfChanged(w, flusher, "plan", h.provider.GetPlanInfo(), &lastPlan) - sendSSEIfChanged(w, flusher, "session", - map[string]any{"stats": h.provider.GetSessionStats(), "sessions": h.provider.GetActiveSessions(), "graph": h.provider.GetSessionGraph()}, - &lastSession) + sendSSEIfChanged( + w, + flusher, + "session", + map[string]any{ + "stats": h.provider.GetSessionStats(), + "sessions": h.provider.GetActiveSessions(), + "graph": h.provider.GetSessionGraph(), + }, + &lastSession, + ) sendSSEIfChanged(w, flusher, "skills", h.provider.ListSkills(), &lastSkills) sendSSEIfChanged(w, flusher, "dev", h.devStatus(), &lastDev) sendSSEIfChanged(w, flusher, "context", h.provider.GetContextInfo(), &lastContext) diff --git a/pkg/miniapp/miniapp_test.go b/pkg/miniapp/miniapp_test.go index 86a07baee..33a32a590 100644 --- a/pkg/miniapp/miniapp_test.go +++ b/pkg/miniapp/miniapp_test.go @@ -282,6 +282,7 @@ func TestMiniApp_StaticFileServerServesAssets(t *testing.T) { }) } } + func TestSSE_AuthRequired(t *testing.T) { notifier := NewStateNotifier() h := NewHandler(&mockDataProvider{}, &mockSender{}, testBotToken, notifier, nil, "") diff --git a/pkg/providers/anthropic/provider_test.go b/pkg/providers/anthropic/provider_test.go index ff1e1ac26..f3be40087 100644 --- a/pkg/providers/anthropic/provider_test.go +++ b/pkg/providers/anthropic/provider_test.go @@ -9,6 +9,7 @@ import ( "github.com/anthropics/anthropic-sdk-go" anthropicoption "github.com/anthropics/anthropic-sdk-go/option" + "github.com/sipeed/picoclaw/pkg/providers/protocoltypes" )