fix(webview): AX-6 banned-import purge in console.go (#624)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

Removed strings import. Replaced strings.ToLower → core.Lower and
strings.Builder → core.NewBuilder.

Closes tasks.lthn.sh/view.php?id=624

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Snider 2026-04-25 10:12:18 +01:00
parent 6d8187a7cc
commit 47c2f01c9c

View file

@ -5,7 +5,6 @@ import (
"context"
"iter"
"slices"
"strings"
"sync" // Note: AX-6 — internal concurrency primitive; structural per RFC §3/§6
"sync/atomic" // Note: AX-6 — internal concurrency primitive; structural per RFC §3/§6
"time"
@ -75,7 +74,7 @@ func NewConsoleWatcher(wv *Webview) *ConsoleWatcher {
// It accepts legacy warning aliases and stores the compact warn form used by
// the existing console message contract.
func normalizeConsoleType(raw string) string {
normalized := strings.ToLower(core.Trim(core.Sprint(raw)))
normalized := core.Lower(core.Trim(core.Sprint(raw)))
if normalized == "warn" || normalized == "warning" {
return "warn"
}
@ -84,7 +83,7 @@ func normalizeConsoleType(raw string) string {
// canonicalConsoleType returns the RFC-canonical console type name.
func canonicalConsoleType(raw string) string {
normalized := strings.ToLower(core.Trim(core.Sprint(raw)))
normalized := core.Lower(core.Trim(core.Sprint(raw)))
if normalized == "warn" || normalized == "warning" {
return "warning"
}
@ -792,7 +791,7 @@ func trimExceptionInfos(exceptions []ExceptionInfo, limit int) []ExceptionInfo {
}
func sanitizeConsoleText(text string) string {
var b strings.Builder
b := core.NewBuilder()
b.Grow(len(text))
for _, r := range text {