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_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'context_test.go') diff --git a/context_test.go b/context_test.go index a0985be9..72ccc62b 100644 --- a/context_test.go +++ b/context_test.go @@ -53,13 +53,13 @@ func TestCreateContext(t *testing.T) { require.NoError(t, err) assert.IsType(t, &tmplctx{}, c) tctx := c.(*tmplctx) - ds := ((*tctx)["foo"]).(map[string]interface{}) + ds := ((*tctx)["foo"]).(map[string]any) assert.Equal(t, "bar", ds["foo"]) t.Setenv("bar", "bar: baz") c, err = createTmplContext(ctx, []string{"."}, sr) require.NoError(t, err) - assert.IsType(t, map[string]interface{}{}, c) - ds = c.(map[string]interface{}) + assert.IsType(t, map[string]any{}, c) + ds = c.(map[string]any) assert.Equal(t, "baz", ds["bar"]) } -- cgit v1.2.3