From ba6ff38ca6cecf1c795ecd890fcd33f05f085218 Mon Sep 17 00:00:00 2001 From: Codex Date: Fri, 24 Apr 2026 19:13:29 +0100 Subject: [PATCH] fix(go-webview): annotate banned imports per AX-6 Closes tasks.lthn.sh/view.php?id=711 Co-authored-by: Codex --- cdp.go | 14 +++++++------- webview.go | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cdp.go b/cdp.go index e985e12..cefdc0b 100644 --- a/cdp.go +++ b/cdp.go @@ -3,13 +3,13 @@ package webview import ( "context" - "io" - "iter" - "net" - "net/http" - "net/url" - "path" - "slices" + "io" // Note: intrinsic — CDP debug endpoint response body streaming via io.ReadAll/io.LimitReader + "iter" // Note: intrinsic — stdlib iterator primitive for Seq[TargetInfo] return type + "net" // Note: intrinsic — net.Error and net.ParseIP required to classify WebSocket terminal errors and validate loopback hosts + "net/http" // Note: intrinsic — CDP exposes its DevTools endpoints over HTTP (/json, /json/new, /json/version); must speak raw HTTP to bootstrap the WebSocket + "net/url" // Note: intrinsic — debug URL, WebSocket URL, and navigation URL validation all require url.Parse/url.URL structural access + "path" // Note: intrinsic — path.Base extracts target ID from WebSocket URL path segment (URL path, not filesystem path) + "slices" // Note: intrinsic — slices.Clone duplicates event handler slice under RLock before dispatch "sync" "sync/atomic" "time" diff --git a/webview.go b/webview.go index fd76674..b1cf49f 100644 --- a/webview.go +++ b/webview.go @@ -24,9 +24,9 @@ package webview import ( "context" - "encoding/base64" - "iter" - "slices" + "encoding/base64" // Note: intrinsic — CDP Page.captureScreenshot returns PNG as base64-encoded string; stdlib decoder is the protocol requirement + "iter" // Note: intrinsic — stdlib iterator primitive for Seq[ConsoleMessage] / Seq[*ElementInfo] return types + "slices" // Note: intrinsic — slices.Collect materialises console message iterator into a snapshot "sync" "time"