aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin/template/template.go8
-rw-r--r--plugin/template/template_test.go2
2 files changed, 5 insertions, 5 deletions
diff --git a/plugin/template/template.go b/plugin/template/template.go
index 48e9d6c54..aee1e1b80 100644
--- a/plugin/template/template.go
+++ b/plugin/template/template.go
@@ -151,10 +151,10 @@ func executeRRTemplate(server, view, section string, template *gotmpl.Template,
}
func newTemplate(name, text string) (*gotmpl.Template, error) {
- funcMap := gotmpl.FuncMap{
- "parseInt": strconv.ParseUint,
- }
- return gotmpl.New(name).Funcs(funcMap).Parse(text)
+ funcMap := gotmpl.FuncMap{
+ "parseInt": strconv.ParseUint,
+ }
+ return gotmpl.New(name).Funcs(funcMap).Parse(text)
}
func (t template) match(ctx context.Context, state request.Request) (*templateData, bool, bool) {
diff --git a/plugin/template/template_test.go b/plugin/template/template_test.go
index 3587742aa..c94deb81f 100644
--- a/plugin/template/template_test.go
+++ b/plugin/template/template_test.go
@@ -284,7 +284,7 @@ func TestHandler(t *testing.T) {
qtype: dns.TypeANY,
qname: "test.example.",
expectedCode: dns.RcodeServerFailure,
- expectedErr: "template: answer:1:26: executing \"answer\" at <parseInt \"gg\" 16 8>: error calling parseInt: strconv.ParseUint: parsing \"gg\": invalid syntax",
+ expectedErr: "template: answer:1:26: executing \"answer\" at <parseInt \"gg\" 16 8>: error calling parseInt: strconv.ParseUint: parsing \"gg\": invalid syntax",
verifyResponse: func(r *dns.Msg) error {
return nil
},