summaryrefslogtreecommitdiff
path: root/internal/funcs/datasource_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/funcs/datasource_test.go')
-rw-r--r--internal/funcs/datasource_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/internal/funcs/datasource_test.go b/internal/funcs/datasource_test.go
index 3c5f5f7f..18050009 100644
--- a/internal/funcs/datasource_test.go
+++ b/internal/funcs/datasource_test.go
@@ -19,14 +19,14 @@ import (
func TestCreateDataSourceFuncs(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 := CreateDataSourceFuncs(ctx, nil)
- actual := fmap["_datasource"].(func() interface{})
+ actual := fmap["_datasource"].(func() any)
assert.Equal(t, ctx, actual().(*dataSourceFuncs).ctx)
})
@@ -57,7 +57,7 @@ func TestDatasource(t *testing.T) {
return d
}
- test := func(ext, mime string, contents []byte, expected interface{}) {
+ test := func(ext, mime string, contents []byte, expected any) {
data := setup(ext, contents)
actual, err := data.Datasource("foo", "?type="+mime)
@@ -67,17 +67,17 @@ func TestDatasource(t *testing.T) {
testObj := func(ext, mime string, contents []byte) {
test(ext, mime, contents,
- map[string]interface{}{
- "hello": map[string]interface{}{"cruel": "world"},
+ map[string]any{
+ "hello": map[string]any{"cruel": "world"},
})
}
testObj("json", iohelpers.JSONMimetype, []byte(`{"hello":{"cruel":"world"}}`))
testObj("yml", iohelpers.YAMLMimetype, []byte("hello:\n cruel: world\n"))
test("json", iohelpers.JSONMimetype, []byte(`[1, "two", true]`),
- []interface{}{1, "two", true})
+ []any{1, "two", true})
test("yaml", iohelpers.YAMLMimetype, []byte("---\n- 1\n- two\n- true\n"),
- []interface{}{1, "two", true})
+ []any{1, "two", true})
d := setup("", nil)
actual, err := d.Datasource("foo")