style: fix golangci-lint formatting (gci, golines)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
seagochen 2026-02-26 16:30:06 +09:00
parent 9fcce86fbd
commit f2c7efcf16
2 changed files with 16 additions and 5 deletions

View file

@ -274,7 +274,10 @@ func (al *AgentLoop) ProcessDirect(ctx context.Context, content, sessionKey stri
// ProcessDirectWithWorkDir processes a message with an explicit working directory context. // ProcessDirectWithWorkDir processes a message with an explicit working directory context.
// The workDir is injected into the system prompt so the AI resolves file paths relative to it. // The workDir is injected into the system prompt so the AI resolves file paths relative to it.
func (al *AgentLoop) ProcessDirectWithWorkDir(ctx context.Context, content, sessionKey, workDir string) (string, error) { func (al *AgentLoop) ProcessDirectWithWorkDir(
ctx context.Context,
content, sessionKey, workDir string,
) (string, error) {
msg := bus.InboundMessage{ msg := bus.InboundMessage{
Channel: "cli", Channel: "cli",
SenderID: "cron", SenderID: "cron",
@ -1338,7 +1341,11 @@ func (al *AgentLoop) handleModeCommand(content, sessionKey string, agent *AgentI
// executeCmdMode executes a shell command in command mode via ExecTool. // executeCmdMode executes a shell command in command mode via ExecTool.
// Output is formatted as a console code block for channel display. // Output is formatted as a console code block for channel display.
func (al *AgentLoop) executeCmdMode(ctx context.Context, agent *AgentInstance, content, sessionKey, channel, chatID string) (string, error) { func (al *AgentLoop) executeCmdMode(
ctx context.Context,
agent *AgentInstance,
content, sessionKey, channel, chatID string,
) (string, error) {
content = strings.TrimSpace(content) content = strings.TrimSpace(content)
if content == "" { if content == "" {
return "", nil return "", nil
@ -1530,7 +1537,11 @@ func editShowFile(path string) string {
data, err := os.ReadFile(path) data, err := os.ReadFile(path)
if err != nil { if err != nil {
if os.IsNotExist(err) { if os.IsNotExist(err) {
return fmt.Sprintf("File not found: %s\nUse :edit %s -m \"\"\" to create it.", shortenHomePath(path), filepath.Base(path)) return fmt.Sprintf(
"File not found: %s\nUse :edit %s -m \"\"\" to create it.",
shortenHomePath(path),
filepath.Base(path),
)
} }
return fmt.Sprintf("Error reading file: %v", err) return fmt.Sprintf("Error reading file: %v", err)
} }

View file

@ -49,8 +49,8 @@ func TestIsPermString(t *testing.T) {
{"drwxr-xr-x", true}, {"drwxr-xr-x", true},
{"-rw-r--r--", true}, {"-rw-r--r--", true},
{"lrwxrwxrwx", true}, {"lrwxrwxrwx", true},
{"-rwsr-xr-x", true}, // setuid {"-rwsr-xr-x", true}, // setuid
{"drwxrwxrwt", true}, // sticky {"drwxrwxrwt", true}, // sticky
{"hello world", false}, // wrong length/chars {"hello world", false}, // wrong length/chars
{"----------", true}, {"----------", true},
{"xrwxrwxrwx", false}, // invalid first char {"xrwxrwxrwx", false}, // invalid first char