all: gofmt -w -r 'interface{} -> any' (#2874)

This commit is contained in:
Ariel Mashraki
2022-08-19 18:23:04 +03:00
committed by GitHub
parent b6c185a660
commit 2c63d1d70e
619 changed files with 3449 additions and 3449 deletions

View File

@@ -17,7 +17,7 @@ import (
func TestEncodeMap(t *testing.T) {
tests := []struct {
name string
in interface{}
in any
want string
}{
{
@@ -47,7 +47,7 @@ func TestEncodeMap(t *testing.T) {
},
{
name: "mixed",
in: map[string]interface{}{
in: map[string]any{
"byte": byte('a'),
"string": "str",
"slice": []int{1, 2, 3},
@@ -119,11 +119,11 @@ func TestEncodeMap(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, "g:Map", jsoniter.Get(data, "@type").ToString())
var want []interface{}
var want []any
err = jsoniter.UnmarshalFromString(tc.want, &want)
require.NoError(t, err)
got, ok := jsoniter.Get(data, "@value").GetInterface().([]interface{})
got, ok := jsoniter.Get(data, "@value").GetInterface().([]any)
require.True(t, ok)
assert.ElementsMatch(t, want, got)
})
@@ -134,7 +134,7 @@ func TestDecodeMap(t *testing.T) {
tests := []struct {
name string
in string
want interface{}
want any
}{
{
name: "empty",