From 79d3c2bfd95c5cb0ac6e4a3f97156161d792c676 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Sun, 24 Apr 2022 18:53:32 +0200 Subject: Replace `interface{}` by `any` --- internal/feed/template/funcs.go | 6 +++--- internal/feed/template/funcs_test.go | 4 ++-- internal/feed/template/template.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/feed/template') diff --git a/internal/feed/template/funcs.go b/internal/feed/template/funcs.go index 30a2975..fbfb572 100644 --- a/internal/feed/template/funcs.go +++ b/internal/feed/template/funcs.go @@ -10,8 +10,8 @@ import ( ) // dict creates a map out of the passed in key/value pairs. -func dict(v ...interface{}) map[string]interface{} { - dict := make(map[string]interface{}) +func dict(v ...any) map[string]any { + dict := make(map[string]any) lenv := len(v) for i := 0; i < lenv; i += 2 { key := v[i].(string) @@ -63,7 +63,7 @@ func _html(s string) html.HTML { return html.HTML(s) } -var funcMap = map[string]interface{}{ +var funcMap = map[string]any{ "dict": dict, "join": join, "lastUrlPart": lastUrlPart, diff --git a/internal/feed/template/funcs_test.go b/internal/feed/template/funcs_test.go index c75d27d..a5c25c3 100644 --- a/internal/feed/template/funcs_test.go +++ b/internal/feed/template/funcs_test.go @@ -31,8 +31,8 @@ func TestByteCount(t *testing.T) { } func TestDict(t *testing.T) { - type i []interface{} - type o map[string]interface{} + type i []any + type o map[string]any tests := map[string]struct { inp i diff --git a/internal/feed/template/template.go b/internal/feed/template/template.go index d66a8e4..4f17717 100644 --- a/internal/feed/template/template.go +++ b/internal/feed/template/template.go @@ -14,7 +14,7 @@ import ( ) type template interface { - Execute(wr io.Writer, data interface{}) error + Execute(wr io.Writer, data any) error Name() string } -- cgit v1.2.3-70-g09d2