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 --- internal/funcs/data_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/funcs/data_test.go') diff --git a/internal/funcs/data_test.go b/internal/funcs/data_test.go index b01530b6..d7dccedf 100644 --- a/internal/funcs/data_test.go +++ b/internal/funcs/data_test.go @@ -11,14 +11,14 @@ import ( func TestCreateDataFuncs(t *testing.T) { t.Parallel() - for i := 0; i < 10; i++ { + for i := range 10 { // Run this a bunch to catch race conditions t.Run(strconv.Itoa(i), func(t *testing.T) { t.Parallel() ctx := context.Background() fmap := CreateDataFuncs(ctx) - actual := fmap["data"].(func() interface{}) + actual := fmap["data"].(func() any) assert.Equal(t, ctx, actual().(*DataFuncs).ctx) }) -- cgit v1.2.3