Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix: errcheck lint errors in test files

L78fd368e1c71
diff --git a/handler_cookies_test.go b/handler_cookies_test.go
index b2549425..d5a7b5b3 100644
--- a/handler_cookies_test.go
+++ b/handler_cookies_test.go
@@ -46,7 +46,9 @@ func TestHandleGetCookies_NameFilter(t *testing.T) {
t.Errorf("expected 404, got %d", w.Code)
}
var resp map[string]any
- json.NewDecoder(w.Body).Decode(&resp)
+ if err := json.NewDecoder(w.Body).Decode(&resp); err != nil {
+ t.Fatalf("decode: %v", err)
+ }
if resp["error"] == nil {
t.Error("expected error in response")
}
diff --git a/state_test.go b/state_test.go
index 64a93343..45b9ed26 100644
--- a/state_test.go
+++ b/state_test.go
@@ -136,8 +136,8 @@ func TestWasUncleanExit_Crashed(t *testing.T) {
defer func() { profileDir = origProfile }()
defaultDir := filepath.Join(tmp, "Default")
- os.MkdirAll(defaultDir, 0755)
- os.WriteFile(filepath.Join(defaultDir, "Preferences"),
+ _ = os.MkdirAll(defaultDir, 0755)
+ _ = os.WriteFile(filepath.Join(defaultDir, "Preferences"),
[]byte(`{"profile":{"exit_type":"Crashed","exited_cleanly":false}}`), 0644)
if !wasUncleanExit() {
@@ -152,8 +152,8 @@ func TestWasUncleanExit_Normal(t *testing.T) {
defer func() { profileDir = origProfile }()
defaultDir := filepath.Join(tmp, "Default")
- os.MkdirAll(defaultDir, 0755)
- os.WriteFile(filepath.Join(defaultDir, "Preferences"),
+ _ = os.MkdirAll(defaultDir, 0755)
+ _ = os.WriteFile(filepath.Join(defaultDir, "Preferences"),
[]byte(`{"profile":{"exit_type":"Normal","exited_cleanly":true}}`), 0644)
if wasUncleanExit() {
@@ -179,8 +179,8 @@ func TestClearChromeSessions(t *testing.T) {
defer func() { profileDir = origProfile }()
sessionsDir := filepath.Join(tmp, "Default", "Sessions")
- os.MkdirAll(sessionsDir, 0755)
- os.WriteFile(filepath.Join(sessionsDir, "Session_1"), []byte("data"), 0644)
+ _ = os.MkdirAll(sessionsDir, 0755)
+ _ = os.WriteFile(filepath.Join(sessionsDir, "Session_1"), []byte("data"), 0644)
clearChromeSessions()