From b7ef05228b182f8eccb0302a9462d13c4480d513 Mon Sep 17 00:00:00 2001 From: sushi30 Date: Sun, 29 Mar 2026 22:38:50 +0200 Subject: [PATCH] fix(lint): fix gci import ordering, golines line length, and govet err shadowing Co-Authored-By: Claude Sonnet 4.6 --- pkg/channels/email/email.go | 8 +++----- pkg/gateway/gateway.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/channels/email/email.go b/pkg/channels/email/email.go index 4714d2093..63940bff2 100644 --- a/pkg/channels/email/email.go +++ b/pkg/channels/email/email.go @@ -9,10 +9,9 @@ import ( "strings" "time" - gomail "github.com/emersion/go-message/mail" - imap "github.com/emersion/go-imap/v2" "github.com/emersion/go-imap/v2/imapclient" + gomail "github.com/emersion/go-message/mail" "github.com/sipeed/picoclaw/pkg/bus" "github.com/sipeed/picoclaw/pkg/channels" @@ -216,12 +215,12 @@ func (c *EmailChannel) pollIMAP() { } defer client.Close() - if err := client.Login(c.config.IMAPUser, c.config.IMAPPassword.String()).Wait(); err != nil { + if err = client.Login(c.config.IMAPUser, c.config.IMAPPassword.String()).Wait(); err != nil { logger.WarnCF("email", "IMAP login failed", map[string]any{"err": err}) return } - if _, err := client.Select("INBOX", nil).Wait(); err != nil { + if _, err = client.Select("INBOX", nil).Wait(); err != nil { logger.WarnCF("email", "IMAP SELECT INBOX failed", map[string]any{"err": err}) return } @@ -371,4 +370,3 @@ func extractPlainText(r io.Reader) string { } return "" } - diff --git a/pkg/gateway/gateway.go b/pkg/gateway/gateway.go index b649ed465..bae538615 100644 --- a/pkg/gateway/gateway.go +++ b/pkg/gateway/gateway.go @@ -19,8 +19,8 @@ import ( "github.com/sipeed/picoclaw/pkg/bus" "github.com/sipeed/picoclaw/pkg/channels" _ "github.com/sipeed/picoclaw/pkg/channels/dingtalk" - _ "github.com/sipeed/picoclaw/pkg/channels/email" _ "github.com/sipeed/picoclaw/pkg/channels/discord" + _ "github.com/sipeed/picoclaw/pkg/channels/email" _ "github.com/sipeed/picoclaw/pkg/channels/feishu" _ "github.com/sipeed/picoclaw/pkg/channels/irc" _ "github.com/sipeed/picoclaw/pkg/channels/line"