aboutsummaryrefslogtreecommitdiff
path: root/src/html/entity_test.go
diff options
context:
space:
mode:
author1911860538 <alxps1911@gmail.com>2024-10-21 16:27:03 +0000
committerGopher Robot <gobot@golang.org>2024-10-21 18:46:08 +0000
commit205ab8a3fe8d7feaedea67d44f09d8ac6af59fd8 (patch)
tree02c3472180c5bbbc134c4a2df88e06783a3587a7 /src/html/entity_test.go
parent2e9ed44d3943164636271f3242b21f0072b6caa7 (diff)
downloadgo-205ab8a3fe8d7feaedea67d44f09d8ac6af59fd8.tar.xz
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 <mpratt@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Commit-Queue: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/html/entity_test.go')
-rw-r--r--src/html/entity_test.go6
1 files changed, 2 insertions, 4 deletions
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")
}