Rename strutil to stringsx, use wg.Go

Address PR review feedback: rename the shared string-helper package
from strutil to stringsx to avoid the discouraged util suffix and the
collision with the standard strings package, updating all import paths
and call sites.

Replace the manual wg.Add/wg.Done bookkeeping in the enrichment worker
with wg.Go, which is less error-prone.

Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
Émile Ré
2026-06-12 12:48:39 +02:00
parent 5e6478aa09
commit 01cd58cba4
5 changed files with 19 additions and 27 deletions

View File

@@ -28,7 +28,7 @@ import (
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/llm"
"go.probo.inc/probo/pkg/strutil"
"go.probo.inc/probo/pkg/stringsx"
"go.probo.inc/probo/pkg/thirdparty"
"go.probo.inc/probo/pkg/uri"
)
@@ -716,15 +716,15 @@ func nameMatchesSiteDomain(name, siteOrigin string) bool {
return false
}
normalizedName := strutil.NormalizeAlnum(name)
normalizedName := stringsx.NormalizeAlnum(name)
if normalizedName == "" {
return false
}
label, _, _ := strings.Cut(domain, ".")
return normalizedName == strutil.NormalizeAlnum(domain) ||
normalizedName == strutil.NormalizeAlnum(label)
return normalizedName == stringsx.NormalizeAlnum(domain) ||
normalizedName == stringsx.NormalizeAlnum(label)
}
// cookieDatabaseAggregators holds alphanumeric-normalised names of pure
@@ -754,11 +754,11 @@ var cookieDatabaseAggregators = map[string]struct{}{
// normalised so spacing, punctuation, and casing differences do not
// matter.
func nameIsCookieDatabaseAggregator(name string) bool {
if _, ok := cookieDatabaseAggregators[strutil.NormalizeAlnum(name)]; ok {
if _, ok := cookieDatabaseAggregators[stringsx.NormalizeAlnum(name)]; ok {
return true
}
label := strutil.NormalizeAlnum(uri.DomainLabel(name))
label := stringsx.NormalizeAlnum(uri.DomainLabel(name))
if label == "" {
return false
}