]> Cypherpunks repositories - gostls13.git/commitdiff
html/template: make FuncMap a type alias of text/template.FuncMap
authorEmmanuel T Odeke <emmanuel@orijtech.com>
Sat, 5 Mar 2022 11:48:27 +0000 (14:48 +0300)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Thu, 31 Mar 2022 00:54:34 +0000 (00:54 +0000)
In preparation to make html/template and text/template use a
single generics package, this change make FuncMap a type alias
of text/template.FuncMap.

Fixes #46121

Change-Id: I5e94cc8fdf4fe029ff223992b5cdfe79f9c098ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/389156
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
api/except.txt
api/next/46121.txt [new file with mode: 0644]
src/html/template/template.go

index b9972c121cfa4addbfdbfe82644b567745da846e..2acd444adf3718558738719aada12f56a01a932f 100644 (file)
@@ -505,3 +505,5 @@ pkg unicode, const Version = "6.3.0"
 pkg unicode, const Version = "7.0.0"
 pkg unicode, const Version = "8.0.0"
 pkg unicode, const Version = "9.0.0"
+pkg html/template, method (*Template) Funcs(FuncMap) *Template
+pkg html/template, type FuncMap map[string]interface{}
diff --git a/api/next/46121.txt b/api/next/46121.txt
new file mode 100644 (file)
index 0000000..a50d645
--- /dev/null
@@ -0,0 +1,2 @@
+pkg html/template, method (*Template) Funcs(template.FuncMap) *Template #46121
+pkg html/template, type FuncMap = template.FuncMap #46121
index 7eba716f1b6648c2272213e9c6a1558108fd85a6..952f52979d5b1543b94769c28dfe0e68418f0f95 100644 (file)
@@ -328,14 +328,7 @@ func (t *Template) Name() string {
        return t.text.Name()
 }
 
-// FuncMap is the type of the map defining the mapping from names to
-// functions. Each function must have either a single return value, or two
-// return values of which the second has type error. In that case, if the
-// second (error) argument evaluates to non-nil during execution, execution
-// terminates and Execute returns that error. FuncMap has the same base type
-// as FuncMap in "text/template", copied here so clients need not import
-// "text/template".
-type FuncMap map[string]any
+type FuncMap = template.FuncMap
 
 // Funcs adds the elements of the argument map to the template's function map.
 // It must be called before the template is parsed.