summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-16 04:01:14 +0200
committerPaul Buetow <paul@buetow.org>2026-03-16 04:01:14 +0200
commit1d49c1e4e4311b26d4ad2fc614b6998ae3f078c8 (patch)
tree12f3497214262e73adcb378fc82649c25f98afc4 /cmd
parentc40056f2102893c4c04aa2fa2380a4146d370e81 (diff)
Use filepath.Join instead of fmt.Sprintf for path construction
Replace string-based path building with filepath.Join in LSP and MCP server log path helpers for platform-correct path separators. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hexai-lsp-server/main.go2
-rw-r--r--cmd/hexai-mcp-server/main.go3
2 files changed, 3 insertions, 2 deletions
diff --git a/cmd/hexai-lsp-server/main.go b/cmd/hexai-lsp-server/main.go
index 6577bc2..3f7ed60 100644
--- a/cmd/hexai-lsp-server/main.go
+++ b/cmd/hexai-lsp-server/main.go
@@ -39,5 +39,5 @@ func defaultLogPath() string {
if err != nil {
return filepath.Join(os.TempDir(), "hexai-lsp-server.log")
}
- return fmt.Sprintf("%s/hexai-lsp-server.log", stateDir)
+ return filepath.Join(stateDir, "hexai-lsp-server.log")
}
diff --git a/cmd/hexai-mcp-server/main.go b/cmd/hexai-mcp-server/main.go
index d2495e6..959c99f 100644
--- a/cmd/hexai-mcp-server/main.go
+++ b/cmd/hexai-mcp-server/main.go
@@ -6,6 +6,7 @@ import (
"fmt"
"io"
"os"
+ "path/filepath"
"codeberg.org/snonux/hexai/internal"
"codeberg.org/snonux/hexai/internal/appconfig"
@@ -120,5 +121,5 @@ func defaultLogPath() (string, error) {
if err != nil {
return "", fmt.Errorf("cannot create state directory: %w", err)
}
- return fmt.Sprintf("%s/hexai-mcp-server.log", stateDir), nil
+ return filepath.Join(stateDir, "hexai-mcp-server.log"), nil
}