From bfa6b9dcef7592e6dd8225aaa0d0ab5aef5b3f84 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sun, 9 Mar 2025 20:14:46 -0400 Subject: chore(refactoring): Refactor/modernizations (#2345) chore(refactoring): Refactor with modernization refactorings * range over int * replace interface{} with any * replace common map operations with maps.Copy/maps.Clone * simplifying loops with slices.Contains/ContainsFunc * modernize benchmarks with b.Loop * modernize tests with t.Context * use fmt.Appendf * range over strings.SplitSeq * use new stdlib crypto/pbkdf2 package --------- Signed-off-by: Dave Henderson --- context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'context.go') diff --git a/context.go b/context.go index d84a2967..471e4ef3 100644 --- a/context.go +++ b/context.go @@ -10,7 +10,7 @@ import ( ) // context for templates -type tmplctx map[string]interface{} +type tmplctx map[string]any // Env - Map environment variables for use in a template func (c *tmplctx) Env() map[string]string { @@ -26,7 +26,7 @@ func (c *tmplctx) Env() map[string]string { func createTmplContext( ctx context.Context, aliases []string, sr datafs.DataSourceReader, -) (interface{}, error) { +) (any, error) { tctx := &tmplctx{} for _, a := range aliases { ct, b, err := sr.ReadSource(ctx, a) -- cgit v1.2.3