From b4f66ff4eb5bbeece5d8215627f9e8d318518074 Mon Sep 17 00:00:00 2001 From: zarzet Date: Fri, 10 Jul 2026 10:25:12 +0700 Subject: [PATCH] chore(backend): align merged test file and fd stubs with lint conventions --- go_backend/extension_signed_session_test.go | 16 ++++++++-------- go_backend/output_fd_windows.go | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/go_backend/extension_signed_session_test.go b/go_backend/extension_signed_session_test.go index d4c17f99..9f44ab6d 100644 --- a/go_backend/extension_signed_session_test.go +++ b/go_backend/extension_signed_session_test.go @@ -340,9 +340,9 @@ func TestSignedSessionStatusAndClear(t *testing.T) { runtime := newSignedSessionTestRuntime(t, "tidal-ext", nil) runtime.manifest.SignedSession = &SignedSessionConfig{Namespace: "tidal", BaseURL: "https://auth.example.com"} - readStatus := func() map[string]interface{} { + readStatus := func() map[string]any { v := runtime.signedSessionStatus(goja.FunctionCall{}) - return v.Export().(map[string]interface{}) + return v.Export().(map[string]any) } if status := readStatus(); status["authenticated"] != false { @@ -378,7 +378,7 @@ func TestSignedSessionStatusAndClear(t *testing.T) { if err := runtime.saveSignedSession(config, record); err != nil { t.Fatalf("unexpected error: %v", err) } - clearResult := runtime.signedSessionClear(goja.FunctionCall{}).Export().(map[string]interface{}) + clearResult := runtime.signedSessionClear(goja.FunctionCall{}).Export().(map[string]any) if clearResult["success"] != true { t.Fatalf("expected clear to succeed, got %+v", clearResult) } @@ -490,7 +490,7 @@ func TestSignedSessionFetchUnauthenticatedTriggersVerification(t *testing.T) { runtime.manifest.SignedSession = &SignedSessionConfig{Namespace: "tidal", BaseURL: "https://auth.example.com"} call := goja.FunctionCall{Arguments: []goja.Value{runtime.vm.ToValue("GET"), runtime.vm.ToValue("/tracks/search")}} - result := runtime.signedSessionFetch(call).Export().(map[string]interface{}) + result := runtime.signedSessionFetch(call).Export().(map[string]any) if result["ok"] != false { t.Fatalf("expected ok=false when unauthenticated, got %+v", result) @@ -534,7 +534,7 @@ func TestSignedSessionFetchRevokesSessionOn401(t *testing.T) { } call := goja.FunctionCall{Arguments: []goja.Value{runtime.vm.ToValue("GET"), runtime.vm.ToValue("/tracks/search")}} - result := runtime.signedSessionFetch(call).Export().(map[string]interface{}) + result := runtime.signedSessionFetch(call).Export().(map[string]any) if result["ok"] != false || result["needsVerification"] != true { t.Fatalf("expected a verification-required response after 401, got %+v", result) } @@ -680,7 +680,7 @@ func TestSignedSessionCompleteGrant(t *testing.T) { runtime.manifest.SignedSession = &SignedSessionConfig{Namespace: "tidal", BaseURL: "https://auth.example.com"} call := goja.FunctionCall{Arguments: []goja.Value{runtime.vm.ToValue("grant-from-arg")}} - result := runtime.signedSessionCompleteGrant(call).Export().(map[string]interface{}) + result := runtime.signedSessionCompleteGrant(call).Export().(map[string]any) if result["success"] != true { t.Fatalf("expected success, got %+v", result) } @@ -696,7 +696,7 @@ func TestSignedSessionCompleteGrant(t *testing.T) { runtime.manifest.SignedSession = &SignedSessionConfig{Namespace: "tidal", BaseURL: "https://auth.example.com"} setPendingSignedSessionGrant(runtime.extensionID, "pending-grant") - result := runtime.signedSessionCompleteGrant(goja.FunctionCall{}).Export().(map[string]interface{}) + result := runtime.signedSessionCompleteGrant(goja.FunctionCall{}).Export().(map[string]any) if result["success"] != true { t.Fatalf("expected success, got %+v", result) } @@ -711,7 +711,7 @@ func TestSignedSessionCompleteGrant(t *testing.T) { t.Run("no grant available reports failure", func(t *testing.T) { runtime := newSignedSessionTestRuntime(t, "tidal-ext-none", nil) - result := runtime.signedSessionCompleteGrant(goja.FunctionCall{}).Export().(map[string]interface{}) + result := runtime.signedSessionCompleteGrant(goja.FunctionCall{}).Export().(map[string]any) if result["success"] != false { t.Fatalf("expected failure without a grant, got %+v", result) } diff --git a/go_backend/output_fd_windows.go b/go_backend/output_fd_windows.go index 9b1290c4..2d9ba30b 100644 --- a/go_backend/output_fd_windows.go +++ b/go_backend/output_fd_windows.go @@ -16,14 +16,14 @@ func seekFDStart(_ int) error { return nil } -func closeFD(fd int) error { +func closeFD(_ int) error { return nil } -func isBestEffortTruncateError(err error) bool { +func isBestEffortTruncateError(_ error) bool { return true } -func isBadFD(err error) bool { +func isBadFD(_ error) bool { return false }