refactor(lint): apply Go best practices across codebase

- Use errors.Is() instead of direct sentinel comparison (13 instances)
- Convert if/else-if chains to switch/case for same-variable comparisons
- Remove redundant bitwise OR with zero
- Add post-implementation checklist to CLAUDE.md
This commit is contained in:
viettranx committed 2026-03-07 20:51:39 +07:00
1 parent df684e2582
commit b62d46e50e
14 files changed
+56 -28

No files matched your search

+2 -1
View File
@@ -3,6 +3,7 @@ package tools
import (
"bytes"
"context"
"errors"
"fmt"
"log/slog"
"os/exec"
@@ -297,7 +298,7 @@ func (t *ExecTool) executeOnHost(ctx context.Context, command, cwd string) *Resu
func (t *ExecTool) executeInSandbox(ctx context.Context, command, cwd, sandboxKey string) *Result {
sb, err := t.sandboxMgr.Get(ctx, sandboxKey, t.workingDir)
if err != nil {
if err == sandbox.ErrSandboxDisabled {
if errors.Is(err, sandbox.ErrSandboxDisabled) {
return t.executeOnHost(ctx, command, cwd)
}
// Docker unavailable (binary missing, daemon down) → fallback to host