From 205ab8a3fe8d7feaedea67d44f09d8ac6af59fd8 Mon Sep 17 00:00:00 2001 From: 1911860538 Date: Mon, 21 Oct 2024 16:27:03 +0000 Subject: html: use sync.OnceValues instead of var once sync.Once Simplify populateMaps with sync.OnceValues. Change-Id: Id52e6e1623c621b8d51e11fecbe3f1fab1e74eb4 GitHub-Last-Rev: 3cf736ae299f14ece401d218d68c3c8870e0cf5a GitHub-Pull-Request: golang/go#69946 Reviewed-on: https://go-review.googlesource.com/c/go/+/621255 Reviewed-by: Michael Pratt Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor Commit-Queue: Ian Lance Taylor --- src/html/entity_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/html/entity_test.go') diff --git a/src/html/entity_test.go b/src/html/entity_test.go index 6688ed2c43..4011da6141 100644 --- a/src/html/entity_test.go +++ b/src/html/entity_test.go @@ -9,11 +9,9 @@ import ( "unicode/utf8" ) -func init() { - UnescapeString("") // force load of entity maps -} - func TestEntityLength(t *testing.T) { + entity, entity2 := entityMaps() + if len(entity) == 0 || len(entity2) == 0 { t.Fatal("maps not loaded") } -- cgit v1.3