mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-17 18:14:13 +00:00
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:
1 parent
df684e2582
commit
b62d46e50e
14 files changed
+56
-28
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user