Skip to content

Commit 986f5e8

Browse files
fix: more lint fixes for ST1005 and QF1003
- Add space separators between concatenated error string parts - Remove trailing punctuation from error messages - Convert if-else chain to tagged switch in handlers_test.go
1 parent 9edd4fd commit 986f5e8

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

internal/client/client.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ func Connect(pipeName string, logger *log.Logger) (*Client, error) {
7878
}
7979
return c, nil
8080
}
81-
return nil, fmt.Errorf("all %d pipes failed. Last error: %w"+
82-
"Try: restart Codex Desktop, then re-open the Codex Chrome Extension.",
81+
return nil, fmt.Errorf("all %d pipes failed; last error: %w. "+
82+
"Try: restart Codex Desktop, then re-open the Codex Chrome Extension",
8383
len(pipes), lastErr)
8484
}
8585

8686
path := discovery.PipePath(pipeName)
8787
conn, err := dialNamedPipe(path)
8888
if err != nil {
89-
return nil, fmt.Errorf("dial pipe %s: %w"+
90-
"This usually means the pipe is stale (Codex Desktop restarted) or the extension lost its host.\n"+
91-
"Try: restart Codex Desktop, then re-open the Codex Chrome Extension.", path, err)
89+
return nil, fmt.Errorf("dial pipe %s: %w. "+
90+
"This usually means the pipe is stale (Codex Desktop restarted) or the extension lost its host. "+
91+
"Try: restart Codex Desktop, then re-open the Codex Chrome Extension", path, err)
9292
}
9393

9494
return NewFromConn(conn, logger), nil

internal/mcp/handlers_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,10 @@ func callToolRaw(t *testing.T, s *MCPServer, name string, args map[string]interf
122122
func flattenContent(content []Content) string {
123123
parts := make([]string, 0, len(content))
124124
for _, c := range content {
125-
if c.Type == "text" {
125+
switch c.Type {
126+
case "text":
126127
parts = append(parts, c.Text)
127-
} else if c.Type == "image" {
128+
case "image":
128129
parts = append(parts, "[image:"+c.MimeType+"]")
129130
}
130131
}

0 commit comments

Comments
 (0)