diff --git a/api/http/handler.go b/api/http/handler.go index 6de1f9c436..9848008575 100644 --- a/api/http/handler.go +++ b/api/http/handler.go @@ -36,15 +36,15 @@ type ctxPeerID struct{} // DataResponse is the GQL top level object holding data for the response payload. type DataResponse struct { - Data interface{} `json:"data"` + Data any `json:"data"` } // simpleDataResponse is a helper function that returns a DataResponse struct. // Odd arguments are the keys and must be strings otherwise they are ignored. // Even arguments are the values associated with the previous key. // Odd arguments are also ignored if there are no following arguments. -func simpleDataResponse(args ...interface{}) DataResponse { - data := make(map[string]interface{}) +func simpleDataResponse(args ...any) DataResponse { + data := make(map[string]any) for i := 0; i < len(args); i += 2 { if len(args) >= i+2 { @@ -81,7 +81,7 @@ func (h *handler) handle(f http.HandlerFunc) http.HandlerFunc { } } -func getJSON(req *http.Request, v interface{}) error { +func getJSON(req *http.Request, v any) error { err := json.NewDecoder(req.Body).Decode(v) if err != nil { return errors.Wrap(err, "unmarshal error") @@ -89,7 +89,7 @@ func getJSON(req *http.Request, v interface{}) error { return nil } -func sendJSON(ctx context.Context, rw http.ResponseWriter, v interface{}, code int) { +func sendJSON(ctx context.Context, rw http.ResponseWriter, v any, code int) { rw.Header().Set("Content-Type", "application/json") b, err := json.Marshal(v) diff --git a/api/http/handler_test.go b/api/http/handler_test.go index 1a2db7409e..df8819e09b 100644 --- a/api/http/handler_test.go +++ b/api/http/handler_test.go @@ -31,29 +31,29 @@ import ( func TestSimpleDataResponse(t *testing.T) { resp := simpleDataResponse("key", "value", "key2", "value2") switch v := resp.Data.(type) { - case map[string]interface{}: + case map[string]any: assert.Equal(t, "value", v["key"]) assert.Equal(t, "value2", v["key2"]) default: - t.Fatalf("data should be of type map[string]interface{} but got %T", resp.Data) + t.Fatalf("data should be of type map[string]any but got %T", resp.Data) } resp2 := simpleDataResponse("key", "value", "key2") switch v := resp2.Data.(type) { - case map[string]interface{}: + case map[string]any: assert.Equal(t, "value", v["key"]) assert.Equal(t, nil, v["key2"]) default: - t.Fatalf("data should be of type map[string]interface{} but got %T", resp.Data) + t.Fatalf("data should be of type map[string]any but got %T", resp.Data) } resp3 := simpleDataResponse("key", "value", 2, "value2") switch v := resp3.Data.(type) { - case map[string]interface{}: + case map[string]any: assert.Equal(t, "value", v["key"]) assert.Equal(t, nil, v["2"]) default: - t.Fatalf("data should be of type map[string]interface{} but got %T", resp.Data) + t.Fatalf("data should be of type map[string]any but got %T", resp.Data) } } diff --git a/api/http/handlerfuncs_test.go b/api/http/handlerfuncs_test.go index a59bf7304d..74c85770fe 100644 --- a/api/http/handlerfuncs_test.go +++ b/api/http/handlerfuncs_test.go @@ -40,7 +40,7 @@ type testOptions struct { Body io.Reader Headers map[string]string ExpectedStatus int - ResponseData interface{} + ResponseData any ServerOptions serverOptions } @@ -65,10 +65,10 @@ func TestRootHandler(t *testing.T) { ResponseData: &resp, }) switch v := resp.Data.(type) { - case map[string]interface{}: + case map[string]any: assert.Equal(t, "Welcome to the DefraDB HTTP API. Use /graphql to send queries to the database", v["response"]) default: - t.Fatalf("data should be of type map[string]interface{} but got %T", resp.Data) + t.Fatalf("data should be of type map[string]any but got %T", resp.Data) } } @@ -85,10 +85,10 @@ func TestPingHandler(t *testing.T) { }) switch v := resp.Data.(type) { - case map[string]interface{}: + case map[string]any: assert.Equal(t, "pong", v["response"]) default: - t.Fatalf("data should be of type map[string]interface{} but got %T", resp.Data) + t.Fatalf("data should be of type map[string]any but got %T", resp.Data) } } @@ -108,10 +108,10 @@ func TestDumpHandlerWithNoError(t *testing.T) { }) switch v := resp.Data.(type) { - case map[string]interface{}: + case map[string]any: assert.Equal(t, "ok", v["response"]) default: - t.Fatalf("data should be of type map[string]interface{} but got %T", resp.Data) + t.Fatalf("data should be of type map[string]any but got %T", resp.Data) } } @@ -591,11 +591,11 @@ type user { }) switch v := resp.Data.(type) { - case map[string]interface{}: + case map[string]any: assert.Equal(t, "success", v["result"]) default: - t.Fatalf("data should be of type map[string]interface{} but got %T\n%v", resp.Data, v) + t.Fatalf("data should be of type map[string]any but got %T\n%v", resp.Data, v) } } @@ -764,7 +764,7 @@ query { }) switch d := resp3.Data.(type) { - case map[string]interface{}: + case map[string]any: switch val := d["val"].(type) { case string: assert.Equal(t, "pGNhZ2UYH2RuYW1lY0JvYmZwb2ludHMYWmh2ZXJpZmllZPU=", val) @@ -772,7 +772,7 @@ query { t.Fatalf("expecting string but got %T", val) } default: - t.Fatalf("expecting map[string]interface{} but got %T", d) + t.Fatalf("expecting map[string]any but got %T", d) } } @@ -792,10 +792,10 @@ func TestPeerIDHandler(t *testing.T) { }) switch v := resp.Data.(type) { - case map[string]interface{}: + case map[string]any: assert.Equal(t, "12D3KooWFpi6VTYKLtxUftJKEyfX8jDfKi8n15eaygH8ggfYFZbR", v["peerID"]) default: - t.Fatalf("data should be of type map[string]interface{} but got %T", resp.Data) + t.Fatalf("data should be of type map[string]any but got %T", resp.Data) } } diff --git a/api/http/logger_test.go b/api/http/logger_test.go index 3a5d09dea7..b8d7b3e28e 100644 --- a/api/http/logger_test.go +++ b/api/http/logger_test.go @@ -103,7 +103,7 @@ func TestLoggerKeyValueOutput(t *testing.T) { assert.Equal(t, float64(28), kv["Length"]) } -func readLog(path string) (map[string]interface{}, error) { +func readLog(path string) (map[string]any, error) { // inspect the log file f, err := os.Open(path) if err != nil { @@ -114,7 +114,7 @@ func readLog(path string) (map[string]interface{}, error) { scanner.Scan() logLine := scanner.Text() - kv := make(map[string]interface{}) + kv := make(map[string]any) err = json.Unmarshal([]byte(logLine), &kv) if err != nil { return nil, errors.WithStack(err) diff --git a/cli/cli.go b/cli/cli.go index e227b648b3..f288010551 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -69,7 +69,7 @@ func indentJSON(b []byte) (string, error) { } type graphqlErrors struct { - Errors interface{} `json:"errors"` + Errors any `json:"errors"` } func hasGraphQLErrors(buf []byte) (bool, error) { diff --git a/cli/peerid.go b/cli/peerid.go index 87ed3ec722..26f02ea79c 100644 --- a/cli/peerid.go +++ b/cli/peerid.go @@ -87,7 +87,7 @@ var peerIDCmd = &cobra.Command{ return fmt.Errorf("mashalling data response failed: %w", err) } cmd.Println(string(b)) - } else if data, ok := r.Data.(map[string]interface{}); ok { + } else if data, ok := r.Data.(map[string]any); ok { log.FeedbackInfo(cmd.Context(), data["peerID"].(string)) } diff --git a/cli/peerid_test.go b/cli/peerid_test.go index 8f78da75ac..d0ebe51fc5 100644 --- a/cli/peerid_test.go +++ b/cli/peerid_test.go @@ -60,7 +60,7 @@ func TestGetPeerIDCmd(t *testing.T) { t.Fatal(err) } - r := make(map[string]interface{}) + r := make(map[string]any) err = json.Unmarshal(out, &r) if err != nil { t.Fatal(err) diff --git a/client/collection.go b/client/collection.go index c1a0e889a2..a320ec842d 100644 --- a/client/collection.go +++ b/client/collection.go @@ -83,12 +83,12 @@ type Collection interface { // // Returns an ErrInvalidUpdateTarget error if the target type is not supported. // Returns an ErrInvalidUpdater error if the updater type is not supported. - UpdateWith(ctx context.Context, target interface{}, updater string) (*UpdateResult, error) + UpdateWith(ctx context.Context, target any, updater string) (*UpdateResult, error) // UpdateWithFilter updates using a filter to target documents for update. // // The provided updater must be a string Patch, string Merge Patch, a parsed Patch, or parsed Merge Patch // else an ErrInvalidUpdater will be returned. - UpdateWithFilter(ctx context.Context, filter interface{}, updater string) (*UpdateResult, error) + UpdateWithFilter(ctx context.Context, filter any, updater string) (*UpdateResult, error) // UpdateWithKey updates using a DocKey to target a single document for update. // // The provided updater must be a string Patch, string Merge Patch, a parsed Patch, or parsed Merge Patch @@ -112,11 +112,11 @@ type Collection interface { // This operation will hard-delete all state relating to the given DocKey. This includes data, block, and head storage. // // Returns an ErrInvalidDeleteTarget if the target type is not supported. - DeleteWith(ctx context.Context, target interface{}) (*DeleteResult, error) + DeleteWith(ctx context.Context, target any) (*DeleteResult, error) // DeleteWithFilter deletes documents matching the given filter. // // This operation will hard-delete all state relating to the given DocKey. This includes data, block, and head storage. - DeleteWithFilter(ctx context.Context, filter interface{}) (*DeleteResult, error) + DeleteWithFilter(ctx context.Context, filter any) (*DeleteResult, error) // DeleteWithKey deletes using a DocKey to target a single document for delete. // // This operation will hard-delete all state relating to the given DocKey. This includes data, block, and head storage. diff --git a/client/db.go b/client/db.go index e93f493f80..f3c04b3e6a 100644 --- a/client/db.go +++ b/client/db.go @@ -40,6 +40,6 @@ type DB interface { } type QueryResult struct { - Errors []interface{} `json:"errors,omitempty"` - Data interface{} `json:"data"` + Errors []any `json:"errors,omitempty"` + Data any `json:"data"` } diff --git a/client/document.go b/client/document.go index 0a520af43f..82aea3c6a7 100644 --- a/client/document.go +++ b/client/document.go @@ -75,7 +75,7 @@ func newEmptyDoc() *Document { } } -func NewDocFromMap(data map[string]interface{}) (*Document, error) { +func NewDocFromMap(data map[string]any) (*Document, error) { var err error doc := &Document{ fields: make(map[string]Field), @@ -127,7 +127,7 @@ func NewDocFromMap(data map[string]interface{}) (*Document, error) { // NewFromJSON creates a new instance of a Document from a raw JSON object byte array func NewDocFromJSON(obj []byte) (*Document, error) { - data := make(map[string]interface{}) + data := make(map[string]any) err := json.Unmarshal(obj, &data) if err != nil { return nil, err @@ -161,7 +161,7 @@ func (doc *Document) Key() DocKey { // a field C // If no matching field exists then return an empty interface // and an error. -func (doc *Document) Get(field string) (interface{}, error) { +func (doc *Document) Get(field string) (any, error) { val, err := doc.GetValue(field) if err != nil { return nil, err @@ -209,7 +209,7 @@ func (doc *Document) GetValueWithField(f Field) (Value, error) { // Patch are to be deleted // @todo: Handle sub documents for SetWithJSON func (doc *Document) SetWithJSON(patch []byte) error { - var patchObj map[string]interface{} + var patchObj map[string]any err := json.Unmarshal(patch, &patchObj) if err != nil { return err @@ -229,12 +229,12 @@ func (doc *Document) SetWithJSON(patch []byte) error { } // Set the value of a field -func (doc *Document) Set(field string, value interface{}) error { +func (doc *Document) Set(field string, value any) error { return doc.setAndParseType(field, value) } // SetAs is the same as set, but you can manually set the CRDT type -func (doc *Document) SetAs(field string, value interface{}, t CType) error { +func (doc *Document) SetAs(field string, value any, t CType) error { return doc.setCBOR(t, field, value) } @@ -253,7 +253,7 @@ func (doc *Document) Delete(fields ...string) error { } // SetAsType Sets the value of a field along with a specific type -// func (doc *Document) SetAsType(t client.CType, field string, value interface{}) error { +// func (doc *Document) SetAsType(t client.CType, field string, value any) error { // return doc.set(t, field, value) // } @@ -272,7 +272,7 @@ func (doc *Document) set(t CType, field string, value Value) error { return nil } -func (doc *Document) setCBOR(t CType, field string, val interface{}) error { +func (doc *Document) setCBOR(t CType, field string, val any) error { value := newCBORValue(t, val) return doc.set(t, field, value) } @@ -283,7 +283,7 @@ func (doc *Document) setObject(t CType, field string, val *Document) error { } // @todo: Update with document schemas -func (doc *Document) setAndParseType(field string, value interface{}) error { +func (doc *Document) setAndParseType(field string, value any) error { if value == nil { return nil } @@ -312,7 +312,7 @@ func (doc *Document) setAndParseType(field string, value interface{}) error { } // string, bool, and more - case string, bool, []interface{}: + case string, bool, []any: err := doc.setCBOR(LWW_REGISTER, field, val) if err != nil { return err @@ -327,7 +327,7 @@ func (doc *Document) setAndParseType(field string, value interface{}) error { // - which is parsed as an int // Use { "Timestamp" : { "_Type": "uint64", "_Value": 123 } } // - Which is parsed as an uint64 - case map[string]interface{}: + case map[string]any: subDoc := newEmptyDoc() err := subDoc.setAndParseObjectType(val) if err != nil { @@ -345,7 +345,7 @@ func (doc *Document) setAndParseType(field string, value interface{}) error { return nil } -func (doc *Document) setAndParseObjectType(value map[string]interface{}) error { +func (doc *Document) setAndParseObjectType(value map[string]any) error { for k, v := range value { err := doc.setAndParseType(k, v) if err != nil { @@ -404,9 +404,9 @@ func (doc *Document) String() string { return string(j) } -// ToMap returns the document as a map[string]interface{} +// ToMap returns the document as a map[string]any // object. -func (doc *Document) ToMap() (map[string]interface{}, error) { +func (doc *Document) ToMap() (map[string]any, error) { return doc.toMapWithKey() } @@ -422,12 +422,12 @@ func (doc *Document) Clean() { } } -// converts the document into a map[string]interface{} +// converts the document into a map[string]any // including any sub documents -func (doc *Document) toMap() (map[string]interface{}, error) { +func (doc *Document) toMap() (map[string]any, error) { doc.mu.RLock() defer doc.mu.RUnlock() - docMap := make(map[string]interface{}) + docMap := make(map[string]any) for k, v := range doc.fields { value, exists := doc.values[v] if !exists { @@ -449,10 +449,10 @@ func (doc *Document) toMap() (map[string]interface{}, error) { return docMap, nil } -func (doc *Document) toMapWithKey() (map[string]interface{}, error) { +func (doc *Document) toMapWithKey() (map[string]any, error) { doc.mu.RLock() defer doc.mu.RUnlock() - docMap := make(map[string]interface{}) + docMap := make(map[string]any) for k, v := range doc.fields { value, exists := doc.values[v] if !exists { @@ -475,13 +475,13 @@ func (doc *Document) toMapWithKey() (map[string]interface{}, error) { return docMap, nil } -// loops through an object of the form map[string]interface{} +// loops through an object of the form map[string]any // and fills in the Document with each field it finds in the object. // Automatically handles sub objects and arrays. // Does not allow anonymous fields, error is thrown in this case // Eg. The JSON value [1,2,3,4] by itself is a valid JSON Object, but has no // field name. -// func parseJSONObject(doc *Document, data map[string]interface{}) error { +// func parseJSONObject(doc *Document, data map[string]any) error { // for k, v := range data { // switch v.(type) { @@ -504,7 +504,7 @@ func (doc *Document) toMapWithKey() (map[string]interface{}, error) { // break // // array -// case []interface{}: +// case []any: // break // // sub object, recurse down. @@ -516,9 +516,9 @@ func (doc *Document) toMapWithKey() (map[string]interface{}, error) { // // - which is parsed as an int // // Use { "Timestamp" : { "_Type": "uint64", "_Value": 123 } } // // - Which is parsed as an uint64 -// case map[string]interface{}: +// case map[string]any: // subDoc := newEmptyDoc() -// err := parseJSONObject(subDoc, v.(map[string]interface{})) +// err := parseJSONObject(subDoc, v.(map[string]any)) // if err != nil { // return err // } @@ -547,7 +547,7 @@ func parseFieldPath(path string) (string, string, bool) { obj := `{ Hello: "World" }` -objData := make(map[string]interface{}) +objData := make(map[string]any) err := json.Unmarshal(&objData, obj) docA := document.NewFromJSON(objData) diff --git a/client/value.go b/client/value.go index 06a2d66c20..997bb9d4d7 100644 --- a/client/value.go +++ b/client/value.go @@ -17,7 +17,7 @@ import ( // Value is an interface that points to a concrete Value implementation // May collapse this down without an interface type Value interface { - Value() interface{} + Value() any IsDocument() bool Type() CType IsDirty() bool @@ -40,17 +40,17 @@ type WriteableValue interface { type ReadableValue interface { Value - Read() (interface{}, error) + Read() (any, error) } type simpleValue struct { t CType - value interface{} + value any isDirty bool delete bool } -func newValue(t CType, val interface{}) simpleValue { +func newValue(t CType, val any) simpleValue { return simpleValue{ t: t, value: val, @@ -58,9 +58,9 @@ func newValue(t CType, val interface{}) simpleValue { } } -// func (val simpleValue) Set(val interface{}) +// func (val simpleValue) Set(val any) -func (val simpleValue) Value() interface{} { +func (val simpleValue) Value() any { return val.value } @@ -96,11 +96,11 @@ type cborValue struct { *simpleValue } -func NewCBORValue(t CType, val interface{}) WriteableValue { +func NewCBORValue(t CType, val any) WriteableValue { return newCBORValue(t, val) } -func newCBORValue(t CType, val interface{}) WriteableValue { +func newCBORValue(t CType, val any) WriteableValue { v := newValue(t, val) return cborValue{&v} } @@ -139,7 +139,7 @@ func (v cborValue) Bytes() ([]byte, error) { // vals []Value // } -// func (l *listValue) Value() interface{} { +// func (l *listValue) Value() any { // return l.vals // } // func (l *listValue) IsDocument() bool { return false } diff --git a/config/config_test.go b/config/config_test.go index b2b584afc0..6861deddb1 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -87,7 +87,7 @@ func TestConfigValidateBasic(t *testing.T) { func TestJSONSerialization(t *testing.T) { cfg := DefaultConfig() - var m map[string]interface{} + var m map[string]any b, errSerialize := cfg.ToJSON() errUnmarshal := json.Unmarshal(b, &m) diff --git a/connor/and.go b/connor/and.go index 2363c4859c..08590bf488 100644 --- a/connor/and.go +++ b/connor/and.go @@ -4,9 +4,9 @@ import "fmt" // and is an operator which allows the evaluation of // of a number of conditions, matching if all of them match. -func and(condition, data interface{}) (bool, error) { +func and(condition, data any) (bool, error) { switch cn := condition.(type) { - case []interface{}: + case []any: for _, c := range cn { if m, err := eq(c, data); err != nil { return false, err diff --git a/connor/connor.go b/connor/connor.go index 464e6b022f..6cdd216112 100644 --- a/connor/connor.go +++ b/connor/connor.go @@ -6,14 +6,14 @@ import ( // Match is the default method used in Connor to match some data to a // set of conditions. -func Match(conditions map[FilterKey]interface{}, data interface{}) (bool, error) { +func Match(conditions map[FilterKey]any, data any) (bool, error) { return eq(conditions, data) } // matchWith can be used to specify the exact operator to use when performing // a match operation. This is primarily used when building custom operators or // if you wish to override the behavior of another operator. -func matchWith(op string, conditions, data interface{}) (bool, error) { +func matchWith(op string, conditions, data any) (bool, error) { switch op { case "_and": return and(conditions, data) diff --git a/connor/eq.go b/connor/eq.go index 451fe86cf3..f84eedce6a 100644 --- a/connor/eq.go +++ b/connor/eq.go @@ -10,7 +10,7 @@ import ( // eq is an operator which performs object equality // tests. -func eq(condition, data interface{}) (bool, error) { +func eq(condition, data any) (bool, error) { switch arr := data.(type) { case []core.Doc: for _, item := range arr { @@ -60,7 +60,7 @@ func eq(condition, data interface{}) (bool, error) { return numbers.Equal(cn, data), nil case float64: return numbers.Equal(cn, data), nil - case map[FilterKey]interface{}: + case map[FilterKey]any: m := true for prop, cond := range cn { var err error diff --git a/connor/ge.go b/connor/ge.go index 0c60956e7b..4e75bcd8b0 100644 --- a/connor/ge.go +++ b/connor/ge.go @@ -8,7 +8,7 @@ import ( // ge does value comparisons to determine whether one // value is strictly larger than or equal to another. -func ge(condition, data interface{}) (bool, error) { +func ge(condition, data any) (bool, error) { if condition == nil { // Everything is greater than or equal to nil return true, nil diff --git a/connor/gt.go b/connor/gt.go index 0b6164c840..96b7fc358b 100644 --- a/connor/gt.go +++ b/connor/gt.go @@ -8,7 +8,7 @@ import ( // gt does value comparisons to determine whether one // value is strictly larger than another. -func gt(condition, data interface{}) (bool, error) { +func gt(condition, data any) (bool, error) { if condition == nil { return data != nil, nil } diff --git a/connor/in.go b/connor/in.go index 06978c55ec..2dd8f11e62 100644 --- a/connor/in.go +++ b/connor/in.go @@ -4,9 +4,9 @@ import "fmt" // in will determine whether a value exists within the // condition's array of available values. -func in(conditions, data interface{}) (bool, error) { +func in(conditions, data any) (bool, error) { switch cn := conditions.(type) { - case []interface{}: + case []any: for _, ce := range cn { if m, err := eq(ce, data); err != nil { return false, err diff --git a/connor/key.go b/connor/key.go index cb81fe56cf..b02769685c 100644 --- a/connor/key.go +++ b/connor/key.go @@ -5,7 +5,7 @@ package connor type FilterKey interface { // GetProp returns the data that should be used with this key // from the given data. - GetProp(data interface{}) interface{} + GetProp(data any) any // GetOperatorOrDefault returns either the operator that corresponds // to this key, or the given default. GetOperatorOrDefault(defaultOp string) string diff --git a/connor/le.go b/connor/le.go index a8ddb14a41..1bb9d1e5c9 100644 --- a/connor/le.go +++ b/connor/le.go @@ -8,7 +8,7 @@ import ( // le does value comparisons to determine whether one // value is strictly less than another. -func le(condition, data interface{}) (bool, error) { +func le(condition, data any) (bool, error) { if condition == nil { // Only nil is less than or equal to nil return data == nil, nil diff --git a/connor/lt.go b/connor/lt.go index 576c45e340..64182a2a74 100644 --- a/connor/lt.go +++ b/connor/lt.go @@ -8,7 +8,7 @@ import ( // lt does value comparisons to determine whether one // value is strictly less than another. -func lt(condition, data interface{}) (bool, error) { +func lt(condition, data any) (bool, error) { if condition == nil { // Nothing is less than nil return false, nil diff --git a/connor/ne.go b/connor/ne.go index 2e6f4661fb..a677229d93 100644 --- a/connor/ne.go +++ b/connor/ne.go @@ -2,7 +2,7 @@ package connor // ne performs object inequality comparisons by inverting // the result of the EqualOperator for non-error cases. -func ne(conditions, data interface{}) (bool, error) { +func ne(conditions, data any) (bool, error) { m, err := eq(conditions, data) if err != nil { diff --git a/connor/nin.go b/connor/nin.go index d8f96a8034..a54f9d102f 100644 --- a/connor/nin.go +++ b/connor/nin.go @@ -2,7 +2,7 @@ package connor // nin performs set exclusion comparisons by inverting the results // of the InOperator under non-error conditions. -func nin(conditions, data interface{}) (bool, error) { +func nin(conditions, data any) (bool, error) { m, err := in(conditions, data) if err != nil { diff --git a/connor/numbers/equality.go b/connor/numbers/equality.go index 8bb528f4e2..b493aa3001 100644 --- a/connor/numbers/equality.go +++ b/connor/numbers/equality.go @@ -1,6 +1,6 @@ package numbers -func Equal(condition, data interface{}) bool { +func Equal(condition, data any) bool { uc := TryUpcast(condition) ud := TryUpcast(data) diff --git a/connor/numbers/upcast.go b/connor/numbers/upcast.go index 1d46dfcd71..e3cea791c8 100644 --- a/connor/numbers/upcast.go +++ b/connor/numbers/upcast.go @@ -1,6 +1,6 @@ package numbers -func TryUpcast(n interface{}) interface{} { +func TryUpcast(n any) any { switch nn := n.(type) { case int8: return int64(nn) diff --git a/connor/or.go b/connor/or.go index 917fe51978..8ca35615a0 100644 --- a/connor/or.go +++ b/connor/or.go @@ -4,9 +4,9 @@ import "fmt" // or is an operator which allows the evaluation of // of a number of conditions, matching if any of them match. -func or(condition, data interface{}) (bool, error) { +func or(condition, data any) (bool, error) { switch cn := condition.(type) { - case []interface{}: + case []any: for _, c := range cn { if m, err := eq(c, data); err != nil { return false, err diff --git a/core/crdt/composite.go b/core/crdt/composite.go index 1e364882a8..4a7b832982 100644 --- a/core/crdt/composite.go +++ b/core/crdt/composite.go @@ -62,7 +62,7 @@ func (delta *CompositeDAGDelta) Marshal() ([]byte, error) { return buf.Bytes(), nil } -func (delta *CompositeDAGDelta) Value() interface{} { +func (delta *CompositeDAGDelta) Value() any { return delta.Data } diff --git a/core/crdt/lwwreg.go b/core/crdt/lwwreg.go index bc86f4cf9e..ec569f49f2 100644 --- a/core/crdt/lwwreg.go +++ b/core/crdt/lwwreg.go @@ -70,7 +70,7 @@ func (delta *LWWRegDelta) Marshal() ([]byte, error) { return buf.Bytes(), nil } -func (delta *LWWRegDelta) Value() interface{} { +func (delta *LWWRegDelta) Value() any { return delta.Data } diff --git a/core/delta.go b/core/delta.go index a92e1872f1..0344a3de12 100644 --- a/core/delta.go +++ b/core/delta.go @@ -20,7 +20,7 @@ type Delta interface { GetPriority() uint64 SetPriority(uint64) Marshal() ([]byte, error) - Value() interface{} + Value() any } type CompositeDelta interface { diff --git a/core/doc.go b/core/doc.go index d2a8f6ef10..f47614a49b 100644 --- a/core/doc.go +++ b/core/doc.go @@ -15,7 +15,7 @@ package core const DocKeyFieldIndex int = 0 -type DocFields []interface{} +type DocFields []any type Doc struct { // If true, this Doc will not be rendered, but will still be passed through // the plan graph just like any other document. @@ -145,14 +145,14 @@ func (mapping *DocumentMapping) NewDoc() Doc { // SetFirstOfName overwrites the first field of this name with the given value. // // Will panic if the field does not exist. -func (mapping *DocumentMapping) SetFirstOfName(d *Doc, name string, value interface{}) { +func (mapping *DocumentMapping) SetFirstOfName(d *Doc, name string, value any) { d.Fields[mapping.IndexesByName[name][0]] = value } // FirstOfName returns the value of the first field of the given name. // // Will panic if the field does not exist (but not if it's value is default). -func (mapping *DocumentMapping) FirstOfName(d Doc, name string) interface{} { +func (mapping *DocumentMapping) FirstOfName(d Doc, name string) any { return d.Fields[mapping.FirstIndexOfName(name)] } @@ -163,20 +163,20 @@ func (mapping *DocumentMapping) FirstIndexOfName(name string) int { return mapping.IndexesByName[name][0] } -// ToMap renders the given document to map[string]interface{} format using +// ToMap renders the given document to map[string]any format using // the given mapping. // // Will not return fields without a render key, or any child documents // marked as Hidden. -func (mapping *DocumentMapping) ToMap(doc Doc) map[string]interface{} { - mappedDoc := make(map[string]interface{}, len(mapping.RenderKeys)) +func (mapping *DocumentMapping) ToMap(doc Doc) map[string]any { + mappedDoc := make(map[string]any, len(mapping.RenderKeys)) for _, renderKey := range mapping.RenderKeys { value := doc.Fields[renderKey.Index] - var renderValue interface{} + var renderValue any switch innerV := value.(type) { case []Doc: innerMapping := mapping.ChildMappings[renderKey.Index] - innerArray := []map[string]interface{}{} + innerArray := []map[string]any{} for _, innerDoc := range innerV { if innerDoc.Hidden { continue diff --git a/core/net/broadcaster.go b/core/net/broadcaster.go index 5ba7384c93..5fdff76f0d 100644 --- a/core/net/broadcaster.go +++ b/core/net/broadcaster.go @@ -16,8 +16,8 @@ import "time" // all replicas and to retrieve payloads broadcasted. type Broadcaster interface { // Send broadcasts a message without blocking - Send(v interface{}) error + Send(v any) error // SendWithTimeout broadcasts a message, blocks up to timeout duration - SendWithTimeout(v interface{}, d time.Duration) error + SendWithTimeout(v any, d time.Duration) error } diff --git a/datastore/badger/v3/compat_logger.go b/datastore/badger/v3/compat_logger.go index 048d67c3ac..caefbe80f6 100644 --- a/datastore/badger/v3/compat_logger.go +++ b/datastore/badger/v3/compat_logger.go @@ -10,13 +10,13 @@ type compatLogger struct { } // Warning is for compatibility -// Deprecated: use Warn(args ...interface{}) instead -func (logger *compatLogger) Warning(args ...interface{}) { +// Deprecated: use Warn(args ...any) instead +func (logger *compatLogger) Warning(args ...any) { logger.skipLogger.Warn(args...) } // Warningf is for compatibility -// Deprecated: use Warnf(format string, args ...interface{}) instead -func (logger *compatLogger) Warningf(format string, args ...interface{}) { +// Deprecated: use Warnf(format string, args ...any) instead +func (logger *compatLogger) Warningf(format string, args ...any) { logger.skipLogger.Warnf(format, args...) } diff --git a/db/base/compare.go b/db/base/compare.go index 5df5f027f9..081cc250cd 100644 --- a/db/base/compare.go +++ b/db/base/compare.go @@ -25,7 +25,7 @@ import ( // The only possible values for a and b is a concrete field type // and they are always the same type as each other. // @todo: Handle list/slice/array fields -func Compare(a, b interface{}) int { +func Compare(a, b any) int { switch v := a.(type) { case bool: return compareBool(v, b.(bool)) diff --git a/db/collection.go b/db/collection.go index 619180e134..9c77f8b37b 100644 --- a/db/collection.go +++ b/db/collection.go @@ -580,7 +580,7 @@ func (c *collection) save( // => Set/Publish new CRDT values primaryKey := c.getPrimaryKeyFromDocKey(doc.Key()) links := make([]core.DAGLink, 0) - merge := make(map[string]interface{}) + merge := make(map[string]any) for k, v := range doc.Fields() { val, err := doc.GetValueWithField(v) if err != nil { @@ -783,7 +783,7 @@ func (c *collection) saveValueToMerkleCRDT( txn datastore.Txn, key core.DataStoreKey, ctype client.CType, - args ...interface{}) (cid.Cid, error) { + args ...any) (cid.Cid, error) { switch ctype { case client.LWW_REGISTER: datatype, err := c.db.crdtFactory.InstanceWithStores( diff --git a/db/collection_delete.go b/db/collection_delete.go index 3ac0173020..02d63b78ca 100644 --- a/db/collection_delete.go +++ b/db/collection_delete.go @@ -40,10 +40,10 @@ var ( // Eg: DeleteWithFilter or DeleteWithKey func (c *collection) DeleteWith( ctx context.Context, - target interface{}, + target any, ) (*client.DeleteResult, error) { switch t := target.(type) { - case string, map[string]interface{}, *parser.Filter: + case string, map[string]any, *parser.Filter: return c.DeleteWithFilter(ctx, t) case client.DocKey: return c.DeleteWithKey(ctx, t) @@ -98,7 +98,7 @@ func (c *collection) DeleteWithKeys( // DeleteWithFilter deletes using a filter to target documents for delete. func (c *collection) DeleteWithFilter( ctx context.Context, - filter interface{}, + filter any, ) (*client.DeleteResult, error) { txn, err := c.getTxn(ctx, false) if err != nil { @@ -186,7 +186,7 @@ func (c *collection) deleteWithKeys( func (c *collection) deleteWithFilter( ctx context.Context, txn datastore.Txn, - filter interface{}, + filter any, ) (*client.DeleteResult, error) { // Do a selection query to scan through documents using the given filter. query, err := c.makeSelectionQuery(ctx, txn, filter) diff --git a/db/collection_update.go b/db/collection_update.go index 745c5a2a51..de0a1750f5 100644 --- a/db/collection_update.go +++ b/db/collection_update.go @@ -45,11 +45,11 @@ var ( // Eg: UpdateWithFilter or UpdateWithKey func (c *collection) UpdateWith( ctx context.Context, - target interface{}, + target any, updater string, ) (*client.UpdateResult, error) { switch t := target.(type) { - case string, map[string]interface{}, *parser.Filter: + case string, map[string]any, *parser.Filter: return c.UpdateWithFilter(ctx, t, updater) case client.DocKey: return c.UpdateWithKey(ctx, t, updater) @@ -65,7 +65,7 @@ func (c *collection) UpdateWith( // or a parsed Patch, or parsed Merge Patch. func (c *collection) UpdateWithFilter( ctx context.Context, - filter interface{}, + filter any, updater string, ) (*client.UpdateResult, error) { txn, err := c.getTxn(ctx, false) @@ -214,7 +214,7 @@ func (c *collection) updateWithKeys( func (c *collection) updateWithFilter( ctx context.Context, txn datastore.Txn, - filter interface{}, + filter any, updater string, ) (*client.UpdateResult, error) { parsedUpdater, err := fastjson.Parse(updater) @@ -287,7 +287,7 @@ func (c *collection) updateWithFilter( func (c *collection) applyPatch( //nolint:unused txn datastore.Txn, - doc map[string]interface{}, + doc map[string]any, patch []*fastjson.Value, ) error { for _, op := range patch { @@ -329,7 +329,7 @@ func (c *collection) applyPatchOp( //nolint:unused txn datastore.Txn, dockey string, field string, - currentVal interface{}, + currentVal any, patchOp *fastjson.Object, ) error { return nil @@ -338,7 +338,7 @@ func (c *collection) applyPatchOp( //nolint:unused func (c *collection) applyMerge( ctx context.Context, txn datastore.Txn, - doc map[string]interface{}, + doc map[string]any, merge *fastjson.Object, ) error { keyStr, ok := doc["_key"].(string) @@ -431,7 +431,7 @@ func (c *collection) applyMerge( // and ensures it matches the supplied field description. // It will do any minor parsing, like dates, and return // the typed value again as an interface. -func validateFieldSchema(val *fastjson.Value, field client.FieldDescription) (interface{}, error) { +func validateFieldSchema(val *fastjson.Value, field client.FieldDescription) (any, error) { switch field.Kind { case client.FieldKind_DocKey, client.FieldKind_STRING: return getString(val) @@ -564,8 +564,8 @@ func (c *collection) applyMergePatchOp( //nolint:unused txn datastore.Txn, docKey string, field string, - currentVal interface{}, - targetVal interface{}) error { + currentVal any, + targetVal any) error { return nil } @@ -576,7 +576,7 @@ func (c *collection) applyMergePatchOp( //nolint:unused func (c *collection) makeSelectionQuery( ctx context.Context, txn datastore.Txn, - filter interface{}, + filter any, ) (planner.Query, error) { mapping := c.createMapping() var f *mapper.Filter @@ -672,7 +672,7 @@ func (c *collection) getCollectionForPatchOpPath( //nolint:unused // It returns the func (c *collection) getTargetKeyForPatchPath( //nolint:unused txn datastore.Txn, - doc map[string]interface{}, + doc map[string]any, path string, ) (string, error) { _, length := splitPatchPath(path) @@ -690,9 +690,9 @@ func splitPatchPath(path string) ([]string, int) { //nolint:unused } func getValFromDocForPatchPath( //nolint:unused - doc map[string]interface{}, + doc map[string]any, path string, -) (string, interface{}, bool) { +) (string, any, bool) { pathParts, length := splitPatchPath(path) if length == 0 { return "", nil, false @@ -701,16 +701,16 @@ func getValFromDocForPatchPath( //nolint:unused } func getMapProp( //nolint:unused - doc map[string]interface{}, + doc map[string]any, paths []string, length int, -) (string, interface{}, bool) { +) (string, any, bool) { val, ok := doc[paths[0]] if !ok { return "", nil, false } if length > 1 { - doc, ok := val.(map[string]interface{}) + doc, ok := val.(map[string]any) if !ok { return "", nil, false } diff --git a/db/db.go b/db/db.go index 1b3bfc566a..653fdcea45 100644 --- a/db/db.go +++ b/db/db.go @@ -66,7 +66,7 @@ type db struct { queryExecutor *planner.QueryExecutor // The options used to init the database - options interface{} + options any } // functional option type diff --git a/db/fetcher/encoded_doc.go b/db/fetcher/encoded_doc.go index 4e9659fb25..ce9ab37be0 100644 --- a/db/fetcher/encoded_doc.go +++ b/db/fetcher/encoded_doc.go @@ -30,16 +30,16 @@ type encProperty struct { } // Decode returns the decoded value and CRDT type for the given property. -func (e encProperty) Decode() (client.CType, interface{}, error) { +func (e encProperty) Decode() (client.CType, any, error) { ctype := client.CType(e.Raw[0]) buf := e.Raw[1:] - var val interface{} + var val any err := cbor.Unmarshal(buf, &val) if err != nil { return ctype, nil, err } - if array, isArray := val.([]interface{}); isArray { + if array, isArray := val.([]any); isArray { var ok bool switch e.Desc.Kind { case client.FieldKind_BOOL_ARRAY: diff --git a/db/query.go b/db/query.go index c05f4a36f3..d4e8e8f007 100644 --- a/db/query.go +++ b/db/query.go @@ -29,19 +29,19 @@ func (db *db) ExecQuery(ctx context.Context, query string) *client.QueryResult { txn, err := db.NewTxn(ctx, false) if err != nil { - res.Errors = []interface{}{err.Error()} + res.Errors = []any{err.Error()} return res } defer txn.Discard(ctx) results, err := db.queryExecutor.ExecQuery(ctx, db, txn, query) if err != nil { - res.Errors = []interface{}{err.Error()} + res.Errors = []any{err.Error()} return res } if err := txn.Commit(ctx); err != nil { - res.Errors = []interface{}{err.Error()} + res.Errors = []any{err.Error()} return res } @@ -62,7 +62,7 @@ func (db *db) ExecTransactionalQuery( results, err := db.queryExecutor.ExecQuery(ctx, db, txn, query) if err != nil { - res.Errors = []interface{}{err.Error()} + res.Errors = []any{err.Error()} return res } @@ -79,7 +79,7 @@ func (db *db) ExecIntrospection(query string) *client.QueryResult { res := &client.QueryResult{ Data: r.Data, - Errors: make([]interface{}, len(r.Errors)), + Errors: make([]any, len(r.Errors)), } for i, err := range r.Errors { diff --git a/errors/errors.go b/errors/errors.go index c801344579..fe2e05609e 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -23,10 +23,10 @@ const MaxStackDepth int = 50 type KV struct { key string - value interface{} + value any } -func NewKV(key string, value interface{}) KV { +func NewKV(key string, value any) KV { return KV{ key: key, value: value, diff --git a/logging/logging.go b/logging/logging.go index c29b924756..22f0fb9a03 100644 --- a/logging/logging.go +++ b/logging/logging.go @@ -19,11 +19,11 @@ var log = MustNewLogger("defra.logging") // KV is a key-value pair used to pass structured data to loggers. type KV struct { key string - value interface{} + value any } // NewKV creates a new KV key-value pair. -func NewKV(key string, value interface{}) KV { +func NewKV(key string, value any) KV { return KV{ key: key, value: value, diff --git a/logging/logging_test.go b/logging/logging_test.go index e5710c9478..3e81f91c0d 100644 --- a/logging/logging_test.go +++ b/logging/logging_test.go @@ -884,7 +884,7 @@ func getFirstOutputPath(outputPaths []string) string { var errloggingToConsole = errors.New("no file to open. Logging to console") -func getLogLines(t *testing.T, logPath string) ([]map[string]interface{}, error) { +func getLogLines(t *testing.T, logPath string) ([]map[string]any, error) { if logPath == stderr { return nil, errloggingToConsole } @@ -903,14 +903,14 @@ func getLogLines(t *testing.T, logPath string) ([]map[string]interface{}, error) return parseLines(file) } -func parseLines(r io.Reader) ([]map[string]interface{}, error) { +func parseLines(r io.Reader) ([]map[string]any, error) { fileScanner := bufio.NewScanner(r) fileScanner.Split(bufio.ScanLines) - logLines := []map[string]interface{}{} + logLines := []map[string]any{} for fileScanner.Scan() { - loggedLine := make(map[string]interface{}) + loggedLine := make(map[string]any) err := json.Unmarshal(fileScanner.Bytes(), &loggedLine) if err != nil { return nil, err diff --git a/net/api/pb/api.pb.go b/net/api/pb/api.pb.go index 2984c6b666..5ce44733c8 100644 --- a/net/api/pb/api.pb.go +++ b/net/api/pb/api.pb.go @@ -196,7 +196,7 @@ func RegisterServiceServer(s *grpc.Server, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) } -func _Service_AddReplicator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Service_AddReplicator_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(AddReplicatorRequest) if err := dec(in); err != nil { return nil, err @@ -208,7 +208,7 @@ func _Service_AddReplicator_Handler(srv interface{}, ctx context.Context, dec fu Server: srv, FullMethod: "/api.pb.Service/AddReplicator", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ServiceServer).AddReplicator(ctx, req.(*AddReplicatorRequest)) } return interceptor(ctx, in, info, handler) diff --git a/net/pb/net.pb.go b/net/pb/net.pb.go index 59784fc6af..6e346ecb27 100644 --- a/net/pb/net.pb.go +++ b/net/pb/net.pb.go @@ -706,7 +706,7 @@ func RegisterServiceServer(s *grpc.Server, srv ServiceServer) { s.RegisterService(&_Service_serviceDesc, srv) } -func _Service_GetDocGraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Service_GetDocGraph_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetDocGraphRequest) if err := dec(in); err != nil { return nil, err @@ -718,13 +718,13 @@ func _Service_GetDocGraph_Handler(srv interface{}, ctx context.Context, dec func Server: srv, FullMethod: "/net.pb.Service/GetDocGraph", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ServiceServer).GetDocGraph(ctx, req.(*GetDocGraphRequest)) } return interceptor(ctx, in, info, handler) } -func _Service_PushDocGraph_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Service_PushDocGraph_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(PushDocGraphRequest) if err := dec(in); err != nil { return nil, err @@ -736,13 +736,13 @@ func _Service_PushDocGraph_Handler(srv interface{}, ctx context.Context, dec fun Server: srv, FullMethod: "/net.pb.Service/PushDocGraph", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ServiceServer).PushDocGraph(ctx, req.(*PushDocGraphRequest)) } return interceptor(ctx, in, info, handler) } -func _Service_GetLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Service_GetLog_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetLogRequest) if err := dec(in); err != nil { return nil, err @@ -754,13 +754,13 @@ func _Service_GetLog_Handler(srv interface{}, ctx context.Context, dec func(inte Server: srv, FullMethod: "/net.pb.Service/GetLog", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ServiceServer).GetLog(ctx, req.(*GetLogRequest)) } return interceptor(ctx, in, info, handler) } -func _Service_PushLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Service_PushLog_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(PushLogRequest) if err := dec(in); err != nil { return nil, err @@ -772,13 +772,13 @@ func _Service_PushLog_Handler(srv interface{}, ctx context.Context, dec func(int Server: srv, FullMethod: "/net.pb.Service/PushLog", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ServiceServer).PushLog(ctx, req.(*PushLogRequest)) } return interceptor(ctx, in, info, handler) } -func _Service_GetHeadLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _Service_GetHeadLog_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { in := new(GetHeadLogRequest) if err := dec(in); err != nil { return nil, err @@ -790,7 +790,7 @@ func _Service_GetHeadLog_Handler(srv interface{}, ctx context.Context, dec func( Server: srv, FullMethod: "/net.pb.Service/GetHeadLog", } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { + handler := func(ctx context.Context, req any) (any, error) { return srv.(ServiceServer).GetHeadLog(ctx, req.(*GetHeadLogRequest)) } return interceptor(ctx, in, info, handler) diff --git a/query/graphql/mapper/mapper.go b/query/graphql/mapper/mapper.go index 257a236e7b..9423db2b47 100644 --- a/query/graphql/mapper/mapper.go +++ b/query/graphql/mapper/mapper.go @@ -596,7 +596,7 @@ func resolveFilterDependencies( func resolveInnerFilterDependencies( descriptionsRepo *DescriptionsRepo, parentCollectionName string, - source map[string]interface{}, + source map[string]any, mapping *core.DocumentMapping, existingFields []Requestable, ) ([]Requestable, error) { @@ -659,7 +659,7 @@ func resolveInnerFilterDependencies( } childSource := source[key] - childFilter, isChildFilter := childSource.(map[string]interface{}) + childFilter, isChildFilter := childSource.(map[string]any) if !isChildFilter { // If the filter is not a child filter then the will be no inner dependencies to add and // we can continue. @@ -779,7 +779,7 @@ func ToFilter(source *parser.Filter, mapping *core.DocumentMapping) *Filter { if source == nil { return nil } - conditions := make(map[connor.FilterKey]interface{}, len(source.Conditions)) + conditions := make(map[connor.FilterKey]any, len(source.Conditions)) for sourceKey, sourceClause := range source.Conditions { key, clause := toFilterMap(sourceKey, sourceClause, mapping) @@ -798,22 +798,22 @@ func ToFilter(source *parser.Filter, mapping *core.DocumentMapping) *Filter { // Return key will either be an int (field index), or a string (operator). func toFilterMap( sourceKey string, - sourceClause interface{}, + sourceClause any, mapping *core.DocumentMapping, -) (connor.FilterKey, interface{}) { +) (connor.FilterKey, any) { if strings.HasPrefix(sourceKey, "_") && sourceKey != parserTypes.DocKeyFieldName { key := &Operator{ Operation: sourceKey, } switch typedClause := sourceClause.(type) { - case []interface{}: + case []any: // If the clause is an array then we need to convert any inner maps. - returnClauses := []interface{}{} + returnClauses := []any{} for _, innerSourceClause := range typedClause { - var returnClause interface{} + var returnClause any switch typedInnerSourceClause := innerSourceClause.(type) { - case map[string]interface{}: - innerMapClause := map[connor.FilterKey]interface{}{} + case map[string]any: + innerMapClause := map[connor.FilterKey]any{} for innerSourceKey, innerSourceValue := range typedInnerSourceClause { rKey, rValue := toFilterMap(innerSourceKey, innerSourceValue, mapping) innerMapClause[rKey] = rValue @@ -838,12 +838,12 @@ func toFilterMap( Index: index, } switch typedClause := sourceClause.(type) { - case map[string]interface{}: - returnClause := map[connor.FilterKey]interface{}{} + case map[string]any: + returnClause := map[connor.FilterKey]any{} for innerSourceKey, innerSourceValue := range typedClause { var innerMapping *core.DocumentMapping switch innerSourceValue.(type) { - case map[string]interface{}: + case map[string]any: // If the innerSourceValue is also a map, then we should parse the nested clause // using the child mapping, as this key must refer to a host property in a join // and deeper keys must refer to properties on the child items. @@ -932,7 +932,7 @@ func toOrderBy(source *parserTypes.OrderBy, mapping *core.DocumentMapping) *Orde // RunFilter runs the given filter expression // using the document, and evaluates. -func RunFilter(doc interface{}, filter *Filter) (bool, error) { +func RunFilter(doc any, filter *Filter) (bool, error) { if filter == nil { return true, nil } @@ -1310,7 +1310,7 @@ func appendNotNilFilter(field *aggregateRequestTarget, childField string) { } if field.filter.Conditions == nil { - field.filter.Conditions = map[string]interface{}{} + field.filter.Conditions = map[string]any{} } var childBlock any @@ -1320,11 +1320,11 @@ func appendNotNilFilter(field *aggregateRequestTarget, childField string) { } else { childBlock, hasChildBlock = field.filter.Conditions[childField] if !hasChildBlock { - childBlock = map[string]interface{}{} + childBlock = map[string]any{} field.filter.Conditions[childField] = childBlock } } - typedChildBlock := childBlock.(map[string]interface{}) + typedChildBlock := childBlock.(map[string]any) typedChildBlock["_ne"] = nil } diff --git a/query/graphql/mapper/targetable.go b/query/graphql/mapper/targetable.go index c420a2ea25..0ec2edf16c 100644 --- a/query/graphql/mapper/targetable.go +++ b/query/graphql/mapper/targetable.go @@ -26,7 +26,7 @@ type PropertyIndex struct { Index int } -func (k *PropertyIndex) GetProp(data interface{}) interface{} { +func (k *PropertyIndex) GetProp(data any) any { if data == nil { return nil } @@ -53,7 +53,7 @@ type Operator struct { Operation string } -func (k *Operator) GetProp(data interface{}) interface{} { +func (k *Operator) GetProp(data any) any { return data } @@ -72,15 +72,15 @@ func (k *Operator) Equal(other connor.FilterKey) bool { // records that a query returns. type Filter struct { // The filter conditions that must pass in order for a record to be returned. - Conditions map[connor.FilterKey]interface{} + Conditions map[connor.FilterKey]any // The filter conditions in human-readable form. - ExternalConditions map[string]interface{} + ExternalConditions map[string]any } func NewFilter() *Filter { return &Filter{ - Conditions: map[connor.FilterKey]interface{}{}, + Conditions: map[connor.FilterKey]any{}, } } diff --git a/query/graphql/parser/filter.go b/query/graphql/parser/filter.go index 1a1b2605e2..7a497cb700 100644 --- a/query/graphql/parser/filter.go +++ b/query/graphql/parser/filter.go @@ -29,7 +29,7 @@ import ( // evaluation. type Filter struct { // parsed filter conditions - Conditions map[string]interface{} + Conditions map[string]any } // type condition @@ -64,10 +64,10 @@ func NewFilterFromString(body string) (*Filter, error) { return NewFilter(obj) } -type parseFn func(*ast.ObjectValue) (interface{}, error) +type parseFn func(*ast.ObjectValue) (any, error) // ParseConditionsInOrder is similar to ParseConditions, except instead -// of returning a map[string]interface{}, we return a []interface{}. This +// of returning a map[string]any, we return a []any. This // is to maintain the ordering info of the statements within the ObjectValue. // This function is mostly used by the Order parser, which needs to parse // conditions in the same way as the Filter object, however the order @@ -84,7 +84,7 @@ func ParseConditionsInOrder(stmt *ast.ObjectValue) ([]parserTypes.OrderCondition return nil, errors.New("Failed to parse statement") } -func parseConditionsInOrder(stmt *ast.ObjectValue) (interface{}, error) { +func parseConditionsInOrder(stmt *ast.ObjectValue) (any, error) { conditions := make([]parserTypes.OrderCondition, 0) if stmt == nil { return conditions, nil @@ -128,20 +128,20 @@ func parseConditionsInOrder(stmt *ast.ObjectValue) (interface{}, error) { // parseConditions loops over the stmt ObjectValue fields, and extracts // all the relevant name/value pairs. -func ParseConditions(stmt *ast.ObjectValue) (map[string]interface{}, error) { +func ParseConditions(stmt *ast.ObjectValue) (map[string]any, error) { cond, err := parseConditions(stmt) if err != nil { return nil, err } - if v, ok := cond.(map[string]interface{}); ok { + if v, ok := cond.(map[string]any); ok { return v, nil } return nil, errors.New("Failed to parse statement") } -func parseConditions(stmt *ast.ObjectValue) (interface{}, error) { - conditions := make(map[string]interface{}) +func parseConditions(stmt *ast.ObjectValue) (any, error) { + conditions := make(map[string]any) if stmt == nil { return conditions, nil } @@ -157,9 +157,9 @@ func parseConditions(stmt *ast.ObjectValue) (interface{}, error) { } // parseVal handles all the various input types, and extracts their -// values, with the correct types, into an interface{}. +// values, with the correct types, into an any. // recurses on ListValue or ObjectValue -func parseVal(val ast.Value, recurseFn parseFn) (interface{}, error) { +func parseVal(val ast.Value, recurseFn parseFn) (any, error) { switch val.GetKind() { case "IntValue": return strconv.ParseInt(val.GetValue().(string), 10, 64) @@ -176,7 +176,7 @@ func parseVal(val ast.Value, recurseFn parseFn) (interface{}, error) { return nil, nil case "ListValue": - list := make([]interface{}, 0) + list := make([]any, 0) for _, item := range val.GetValue().([]ast.Value) { v, err := parseVal(item, recurseFn) if err != nil { diff --git a/query/graphql/parser/mutation_test.go b/query/graphql/parser/mutation_test.go index b6311d0a7c..43ae1be2d8 100644 --- a/query/graphql/parser/mutation_test.go +++ b/query/graphql/parser/mutation_test.go @@ -43,7 +43,7 @@ func TestMutationParse_Create_Simple(t *testing.T) { assert.Equal(t, "create_Book", createMutation.Name) assert.Equal(t, CreateObjects, createMutation.Type) assert.Equal(t, "Book", createMutation.Schema) - // assert.Equal(t, map[string]interface{}{ + // assert.Equal(t, map[string]any{ // "a": float64(1), // json numbers are always floats // }, createMutation.Data.Object) assert.Len(t, createMutation.Fields, 1) @@ -74,7 +74,7 @@ func TestMutationParse_Create_Error_Missing_Data(t *testing.T) { // assert.Equal(t, "create_Book", createMutation.Name) // assert.Equal(t, CreateObjects, createMutation.Type) // assert.Equal(t, "Book", createMutation.Schema) - // assert.Equal(t, map[string]interface{}{ + // assert.Equal(t, map[string]any{ // "a": float64(1), // json numbers are always floats // }, createMutation.Data.Object) // assert.Len(t, createMutation.Fields, 1) @@ -105,7 +105,7 @@ func TestMutationParse_Error_Invalid_Mutation(t *testing.T) { // assert.Equal(t, "create_Book", createMutation.Name) // assert.Equal(t, CreateObjects, createMutation.Type) // assert.Equal(t, "Book", createMutation.Schema) - // assert.Equal(t, map[string]interface{}{ + // assert.Equal(t, map[string]any{ // "a": float64(1), // json numbers are always floats // }, createMutation.Data.Object) // assert.Len(t, createMutation.Fields, 1) @@ -136,7 +136,7 @@ func TestMutationParse_Update_Simple_Object(t *testing.T) { assert.Equal(t, "update_Book", mut.Name) assert.Equal(t, UpdateObjects, mut.Type) assert.Equal(t, "Book", mut.Schema) - // assert.Equal(t, map[string]interface{}{ + // assert.Equal(t, map[string]any{ // "a": float64(1), // json numbers are always floats // }, mut.Data.Object) assert.Len(t, mut.Fields, 1) @@ -168,8 +168,8 @@ func TestMutationParse_Update_Simple_Array(t *testing.T) { // assert.Equal(t, UpdateObjects, mut.Type) // assert.Equal(t, "Book", mut.Schema) // assert.Empty(t, mut.Data) - // assert.Equal(t, []interface{}{ - // map[string]interface{}{ + // assert.Equal(t, []any{ + // map[string]any{ // "a": float64(1), // json numbers are always floats // }, // }, mut.Data.Array) @@ -201,13 +201,13 @@ func TestMutationParse_Update_Filter(t *testing.T) { assert.Equal(t, "update_Book", mut.Name) assert.Equal(t, UpdateObjects, mut.Type) assert.Equal(t, "Book", mut.Schema) - // assert.Equal(t, map[string]interface{}{ + // assert.Equal(t, map[string]any{ // "a": float64(1), // json numbers are always floats // }, mut.Data.Object) assert.Len(t, mut.Fields, 1) assert.NotNil(t, mut.Filter) - assert.Equal(t, map[string]interface{}{ - "rating": map[string]interface{}{ + assert.Equal(t, map[string]any{ + "rating": map[string]any{ "_gt": 4.5, }, }, mut.Filter.Conditions) @@ -238,7 +238,7 @@ func TestMutationParse_Update_Simple_UnderscoreName(t *testing.T) { assert.Equal(t, "update_my_book", mut.Name) assert.Equal(t, UpdateObjects, mut.Type) assert.Equal(t, "my_book", mut.Schema) - // assert.Equal(t, map[string]interface{}{ + // assert.Equal(t, map[string]any{ // "a": float64(1), // json numbers are always floats // }, mut.Data.Object) assert.Len(t, mut.Fields, 1) @@ -269,7 +269,7 @@ func TestMutationParse_Delete_Simple(t *testing.T) { assert.Equal(t, "delete_Book", mut.Name) assert.Equal(t, DeleteObjects, mut.Type) assert.Equal(t, "Book", mut.Schema) - // assert.Equal(t, map[string]interface{}{ + // assert.Equal(t, map[string]any{ // "a": float64(1), // json numbers are always floats // }, mut.Data.Object) assert.Len(t, mut.Fields, 1) diff --git a/query/graphql/planner/average.go b/query/graphql/planner/average.go index 4baf150deb..b8afc0f35b 100644 --- a/query/graphql/planner/average.go +++ b/query/graphql/planner/average.go @@ -101,6 +101,6 @@ func (n *averageNode) SetPlan(p planNode) { n.plan = p } // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *averageNode) Explain() (map[string]interface{}, error) { - return map[string]interface{}{}, nil +func (n *averageNode) Explain() (map[string]any, error) { + return map[string]any{}, nil } diff --git a/query/graphql/planner/commit.go b/query/graphql/planner/commit.go index 806a975235..502e2b4e21 100644 --- a/query/graphql/planner/commit.go +++ b/query/graphql/planner/commit.go @@ -95,8 +95,8 @@ func (n *commitSelectNode) Source() planNode { // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *commitSelectNode) Explain() (map[string]interface{}, error) { - return map[string]interface{}{}, nil +func (n *commitSelectNode) Explain() (map[string]any, error) { + return map[string]any{}, nil } func (p *Planner) CommitSelect(parsed *mapper.CommitSelect) (planNode, error) { diff --git a/query/graphql/planner/count.go b/query/graphql/planner/count.go index 703876b8ee..358c328576 100644 --- a/query/graphql/planner/count.go +++ b/query/graphql/planner/count.go @@ -61,11 +61,11 @@ func (n *countNode) Source() planNode { return n.plan } // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *countNode) Explain() (map[string]interface{}, error) { - sourceExplanations := make([]map[string]interface{}, len(n.aggregateMapping)) +func (n *countNode) Explain() (map[string]any, error) { + sourceExplanations := make([]map[string]any, len(n.aggregateMapping)) for i, source := range n.aggregateMapping { - explainerMap := map[string]interface{}{} + explainerMap := map[string]any{} // Add the filter attribute if it exists. if source.Filter == nil || source.Filter.ExternalConditions == nil { @@ -80,7 +80,7 @@ func (n *countNode) Explain() (map[string]interface{}, error) { sourceExplanations[i] = explainerMap } - return map[string]interface{}{ + return map[string]any{ sourcesLabel: sourceExplanations, }, nil } diff --git a/query/graphql/planner/create.go b/query/graphql/planner/create.go index da9f7a9ca0..aa10b626cb 100644 --- a/query/graphql/planner/create.go +++ b/query/graphql/planner/create.go @@ -129,14 +129,14 @@ func (n *createNode) Source() planNode { return n.results } // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *createNode) Explain() (map[string]interface{}, error) { - data := map[string]interface{}{} +func (n *createNode) Explain() (map[string]any, error) { + data := map[string]any{} err := json.Unmarshal([]byte(n.newDocStr), &data) if err != nil { return nil, err } - return map[string]interface{}{ + return map[string]any{ dataLabel: data, }, nil } diff --git a/query/graphql/planner/dagscan.go b/query/graphql/planner/dagscan.go index 4940c52346..19d5d8ddb4 100644 --- a/query/graphql/planner/dagscan.go +++ b/query/graphql/planner/dagscan.go @@ -225,8 +225,8 @@ func (n *dagScanNode) Source() planNode { return n.headset } // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *dagScanNode) Explain() (map[string]interface{}, error) { - explainerMap := map[string]interface{}{} +func (n *dagScanNode) Explain() (map[string]any, error) { + explainerMap := map[string]any{} // Add the field attribute to the explaination if it exists. if len(n.field) != 0 { @@ -243,13 +243,13 @@ func (n *dagScanNode) Explain() (map[string]interface{}, error) { } // Build the explaination of the spans attribute. - spansExplainer := []map[string]interface{}{} + spansExplainer := []map[string]any{} // Note: n.headset is `nil` for single commit selection query, so must check for it. if n.headset != nil && n.headset.spans.HasValue { for _, span := range n.headset.spans.Value { spansExplainer = append( spansExplainer, - map[string]interface{}{ + map[string]any{ "start": span.Start().ToString(), "end": span.End().ToString(), }, @@ -383,7 +383,7 @@ func (n *dagScanNode) dagBlockToNodeDoc(block blocks.Block) (core.Doc, []*ipld.L } // @todo: Wrap delta unmarshaling into a proper typed interface. - var delta map[string]interface{} + var delta map[string]any if err := cbor.Unmarshal(nd.Data(), &delta); err != nil { return core.Doc{}, nil, err } diff --git a/query/graphql/planner/delete.go b/query/graphql/planner/delete.go index 2634490c96..424fd29af2 100644 --- a/query/graphql/planner/delete.go +++ b/query/graphql/planner/delete.go @@ -76,8 +76,8 @@ func (n *deleteNode) Source() planNode { // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *deleteNode) Explain() (map[string]interface{}, error) { - explainerMap := map[string]interface{}{} +func (n *deleteNode) Explain() (map[string]any, error) { + explainerMap := map[string]any{} // Add the document id(s) that request wants to delete. explainerMap[idsLabel] = n.ids diff --git a/query/graphql/planner/executor.go b/query/graphql/planner/executor.go index f9dfb70436..56065013db 100644 --- a/query/graphql/planner/executor.go +++ b/query/graphql/planner/executor.go @@ -66,8 +66,8 @@ func (e *QueryExecutor) ExecQuery( db client.DB, txn datastore.Txn, query string, - args ...interface{}, -) ([]map[string]interface{}, error) { + args ...any, +) ([]map[string]any, error) { q, err := e.ParseRequestString(query) if err != nil { return nil, err diff --git a/query/graphql/planner/group.go b/query/graphql/planner/group.go index ecffbaed0e..c623f47862 100644 --- a/query/graphql/planner/group.go +++ b/query/graphql/planner/group.go @@ -174,8 +174,8 @@ func (n *groupNode) Next() (bool, error) { // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *groupNode) Explain() (map[string]interface{}, error) { - explainerMap := map[string]interface{}{} +func (n *groupNode) Explain() (map[string]any, error) { + explainerMap := map[string]any{} // Get the parent level groupBy attribute(s). groupByFields := []string{} @@ -191,13 +191,13 @@ func (n *groupNode) Explain() (map[string]interface{}, error) { if len(n.childSelects) == 0 { explainerMap["childSelects"] = nil } else { - childSelects := make([]map[string]interface{}, 0, len(n.childSelects)) + childSelects := make([]map[string]any, 0, len(n.childSelects)) for _, child := range n.childSelects { if child == nil { continue } - childExplainGraph := map[string]interface{}{} + childExplainGraph := map[string]any{} childExplainGraph[collectionNameLabel] = child.CollectionName @@ -218,7 +218,7 @@ func (n *groupNode) Explain() (map[string]interface{}, error) { } if c.Limit != nil { - childExplainGraph[limitLabel] = map[string]interface{}{ + childExplainGraph[limitLabel] = map[string]any{ limitLabel: c.Limit.Limit, offsetLabel: c.Limit.Offset, } @@ -227,7 +227,7 @@ func (n *groupNode) Explain() (map[string]interface{}, error) { } if c.OrderBy != nil { - innerOrderings := []map[string]interface{}{} + innerOrderings := []map[string]any{} for _, condition := range c.OrderBy.Conditions { orderFieldNames := []string{} @@ -245,7 +245,7 @@ func (n *groupNode) Explain() (map[string]interface{}, error) { } // Put it all together for this order element. innerOrderings = append(innerOrderings, - map[string]interface{}{ + map[string]any{ "fields": orderFieldNames, "direction": string(condition.Direction), }, diff --git a/query/graphql/planner/limit.go b/query/graphql/planner/limit.go index 4d00594272..b83d0cf7c2 100644 --- a/query/graphql/planner/limit.go +++ b/query/graphql/planner/limit.go @@ -80,8 +80,8 @@ func (n *limitNode) Next() (bool, error) { func (n *limitNode) Source() planNode { return n.plan } -func (n *limitNode) Explain() (map[string]interface{}, error) { - exp := map[string]interface{}{ +func (n *limitNode) Explain() (map[string]any, error) { + exp := map[string]any{ limitLabel: n.limit, offsetLabel: n.offset, } diff --git a/query/graphql/planner/order.go b/query/graphql/planner/order.go index 3aac13eb8a..4d11b93dbf 100644 --- a/query/graphql/planner/order.go +++ b/query/graphql/planner/order.go @@ -99,8 +99,8 @@ func (n *orderNode) Value() core.Doc { // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *orderNode) Explain() (map[string]interface{}, error) { - orderings := []map[string]interface{}{} +func (n *orderNode) Explain() (map[string]any, error) { + orderings := []map[string]any{} for _, element := range n.ordering { // Build the list containing the corresponding names of all the indexes. @@ -117,14 +117,14 @@ func (n *orderNode) Explain() (map[string]interface{}, error) { // Put it all together for this order element. orderings = append(orderings, - map[string]interface{}{ + map[string]any{ "fields": fieldNames, "direction": string(element.Direction), }, ) } - return map[string]interface{}{ + return map[string]any{ "orderings": orderings, }, nil } diff --git a/query/graphql/planner/planner.go b/query/graphql/planner/planner.go index 18c6ab6ba5..8fe6162c19 100644 --- a/query/graphql/planner/planner.go +++ b/query/graphql/planner/planner.go @@ -103,7 +103,7 @@ func makePlanner(ctx context.Context, db client.DB, txn datastore.Txn) *Planner } } -func (p *Planner) newPlan(stmt interface{}) (planNode, error) { +func (p *Planner) newPlan(stmt any) (planNode, error) { switch n := stmt.(type) { case *parser.Query: if len(n.Queries) > 0 { @@ -173,7 +173,7 @@ func (p *Planner) newObjectMutationPlan(stmt *mapper.Mutation) (planNode, error) // makePlan creates a new plan from the parsed data, optimizes the plan and returns // an initiated plan. The caller of makePlan is also responsible of calling Close() // on the plan to free it's resources. -func (p *Planner) makePlan(stmt interface{}) (planNode, error) { +func (p *Planner) makePlan(stmt any) (planNode, error) { plan, err := p.newPlan(stmt) if err != nil { return nil, err @@ -440,7 +440,7 @@ func (p *Planner) walkAndFindPlanType(plan, target planNode) planNode { func (p *Planner) explainRequest( ctx context.Context, plan planNode, -) ([]map[string]interface{}, error) { +) ([]map[string]any, error) { if plan == nil { return nil, fmt.Errorf("Can't explain request of a nil plan.") } @@ -450,7 +450,7 @@ func (p *Planner) explainRequest( return nil, multiErr(err, plan.Close()) } - topExplainGraph := []map[string]interface{}{ + topExplainGraph := []map[string]any{ { parserTypes.ExplainLabel: explainGraph, }, @@ -463,7 +463,7 @@ func (p *Planner) explainRequest( func (p *Planner) executeRequest( ctx context.Context, plan planNode, -) ([]map[string]interface{}, error) { +) ([]map[string]any, error) { if plan == nil { return nil, fmt.Errorf("Can't execute request of a nil plan.") } @@ -477,7 +477,7 @@ func (p *Planner) executeRequest( return nil, multiErr(err, plan.Close()) } - docs := []map[string]interface{}{} + docs := []map[string]any{} docMap := plan.DocumentMap() for next { @@ -501,7 +501,7 @@ func (p *Planner) executeRequest( func (p *Planner) runRequest( ctx context.Context, query *parser.Query, -) ([]map[string]interface{}, error) { +) ([]map[string]any, error) { plan, err := p.makePlan(query) if err != nil { diff --git a/query/graphql/planner/scan.go b/query/graphql/planner/scan.go index e089ed6639..9a98eb9005 100644 --- a/query/graphql/planner/scan.go +++ b/query/graphql/planner/scan.go @@ -118,10 +118,10 @@ func (n *scanNode) Close() error { func (n *scanNode) Source() planNode { return nil } // explainSpans explains the spans attribute. -func (n *scanNode) explainSpans() []map[string]interface{} { - spansExplainer := []map[string]interface{}{} +func (n *scanNode) explainSpans() []map[string]any { + spansExplainer := []map[string]any{} for _, span := range n.spans.Value { - spanExplainer := map[string]interface{}{ + spanExplainer := map[string]any{ "start": span.Start().ToString(), "end": span.End().ToString(), } @@ -134,8 +134,8 @@ func (n *scanNode) explainSpans() []map[string]interface{} { // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *scanNode) Explain() (map[string]interface{}, error) { - explainerMap := map[string]interface{}{} +func (n *scanNode) Explain() (map[string]any, error) { + explainerMap := map[string]any{} // Add the filter attribute if it exists. if n.filter == nil || n.filter.ExternalConditions == nil { diff --git a/query/graphql/planner/select.go b/query/graphql/planner/select.go index 7e4af20555..4919299183 100644 --- a/query/graphql/planner/select.go +++ b/query/graphql/planner/select.go @@ -78,7 +78,7 @@ func (n *selectTopNode) Source() planNode { return n.plan } // Explain method for selectTopNode returns no attributes but is used to // subscribe / opt-into being an explainablePlanNode. -func (n *selectTopNode) Explain() (map[string]interface{}, error) { +func (n *selectTopNode) Explain() (map[string]any, error) { // No attributes are returned for selectTopNode. return nil, nil } @@ -166,8 +166,8 @@ func (n *selectNode) Close() error { // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *selectNode) Explain() (map[string]interface{}, error) { - explainerMap := map[string]interface{}{} +func (n *selectNode) Explain() (map[string]any, error) { + explainerMap := map[string]any{} // Add the filter attribute if it exists. if n.filter == nil || n.filter.ExternalConditions == nil { diff --git a/query/graphql/planner/sum.go b/query/graphql/planner/sum.go index dfa39191b0..5c4763479c 100644 --- a/query/graphql/planner/sum.go +++ b/query/graphql/planner/sum.go @@ -156,11 +156,11 @@ func (n *sumNode) Source() planNode { return n.plan } // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *sumNode) Explain() (map[string]interface{}, error) { - sourceExplanations := make([]map[string]interface{}, len(n.aggregateMapping)) +func (n *sumNode) Explain() (map[string]any, error) { + sourceExplanations := make([]map[string]any, len(n.aggregateMapping)) for i, source := range n.aggregateMapping { - explainerMap := map[string]interface{}{} + explainerMap := map[string]any{} // Add the filter attribute if it exists. if source.Filter == nil || source.Filter.ExternalConditions == nil { @@ -182,7 +182,7 @@ func (n *sumNode) Explain() (map[string]interface{}, error) { sourceExplanations[i] = explainerMap } - return map[string]interface{}{ + return map[string]any{ sourcesLabel: sourceExplanations, }, nil } @@ -271,7 +271,7 @@ func (n *sumNode) Next() (bool, error) { sum += collectionSum } - var typedSum interface{} + var typedSum any if n.isFloat { typedSum = sum } else { diff --git a/query/graphql/planner/type_join.go b/query/graphql/planner/type_join.go index d2efa63cc1..7d6507f025 100644 --- a/query/graphql/planner/type_join.go +++ b/query/graphql/planner/type_join.go @@ -61,7 +61,7 @@ type typeIndexJoin struct { // based on the relationship of the sub types joinPlan planNode - // doc map[string]interface{} + // doc map[string]any // spans core.Spans } @@ -133,7 +133,7 @@ func (n *typeIndexJoin) Source() planNode { return n.joinPlan } // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *typeIndexJoin) Explain() (map[string]interface{}, error) { +func (n *typeIndexJoin) Explain() (map[string]any, error) { const ( joinTypeLabel = "joinType" joinDirectionLabel = "direction" @@ -144,7 +144,7 @@ func (n *typeIndexJoin) Explain() (map[string]interface{}, error) { joinRootLabel = "rootName" ) - explainerMap := map[string]interface{}{} + explainerMap := map[string]any{} // Add the type attribute. explainerMap[joinTypeLabel] = n.joinPlan.Kind() @@ -216,8 +216,8 @@ func splitFilterByType(filter *mapper.Filter, subType int) (*mapper.Filter, *map } // create new splitup filter - // our schema ensures that if sub exists, its of type map[string]interface{} - splitF := &mapper.Filter{Conditions: map[connor.FilterKey]interface{}{conditionKey: sub}} + // our schema ensures that if sub exists, its of type map[string]any + splitF := &mapper.Filter{Conditions: map[connor.FilterKey]any{conditionKey: sub}} return filter, splitF } @@ -327,7 +327,7 @@ func (n *typeJoinOne) valuesSecondary(doc core.Doc) core.Doc { fkIndex := &mapper.PropertyIndex{ Index: n.subType.DocumentMap().FirstIndexOfName(n.subTypeFieldName + "_id"), } - filter := map[connor.FilterKey]interface{}{ + filter := map[connor.FilterKey]any{ fkIndex: doc.GetKey(), } // using the doc._key as a filter @@ -496,7 +496,7 @@ func (n *typeJoinMany) Next() (bool, error) { fkIndex := &mapper.PropertyIndex{ Index: n.subSelect.FirstIndexOfName(n.rootName + "_id"), } - filter := map[connor.FilterKey]interface{}{ + filter := map[connor.FilterKey]any{ fkIndex: n.currentValue.GetKey(), // user_id: "bae-ALICE" | user_id: "bae-CHARLIE" } // using the doc._key as a filter @@ -538,7 +538,7 @@ func (n *typeJoinMany) Close() error { func (n *typeJoinMany) Source() planNode { return n.root } -func appendFilterToScanNode(plan planNode, filterCondition map[connor.FilterKey]interface{}) error { +func appendFilterToScanNode(plan planNode, filterCondition map[connor.FilterKey]any) error { switch node := plan.(type) { case *scanNode: filter := node.filter @@ -567,8 +567,8 @@ func appendFilterToScanNode(plan planNode, filterCondition map[connor.FilterKey] func removeConditionIndex( key *mapper.PropertyIndex, - filterConditions map[connor.FilterKey]interface{}, -) (bool, interface{}) { + filterConditions map[connor.FilterKey]any, +) (bool, any) { for targetKey, clause := range filterConditions { if indexKey, isIndexKey := targetKey.(*mapper.PropertyIndex); isIndexKey { if key.Index == indexKey.Index { diff --git a/query/graphql/planner/update.go b/query/graphql/planner/update.go index a849159e83..6a79fb0828 100644 --- a/query/graphql/planner/update.go +++ b/query/graphql/planner/update.go @@ -98,8 +98,8 @@ func (n *updateNode) Source() planNode { return n.results } // Explain method returns a map containing all attributes of this node that // are to be explained, subscribes / opts-in this node to be an explainablePlanNode. -func (n *updateNode) Explain() (map[string]interface{}, error) { - explainerMap := map[string]interface{}{} +func (n *updateNode) Explain() (map[string]any, error) { + explainerMap := map[string]any{} // Add the document id(s) that request wants to update. explainerMap[idsLabel] = n.ids @@ -112,7 +112,7 @@ func (n *updateNode) Explain() (map[string]interface{}, error) { } // Add the attribute that represents the patch to update with. - data := map[string]interface{}{} + data := map[string]any{} err := json.Unmarshal([]byte(n.patch), &data) if err != nil { return nil, err diff --git a/query/graphql/planner/values.go b/query/graphql/planner/values.go index 3832f2a0cc..77ec29d766 100644 --- a/query/graphql/planner/values.go +++ b/query/graphql/planner/values.go @@ -92,7 +92,7 @@ func (n *valuesNode) Less(i, j int) bool { // docValueLess extracts and compare field values of a document func (n *valuesNode) docValueLess(da, db core.Doc) bool { - var ra, rb interface{} + var ra, rb any for _, order := range n.ordering { if order.Direction == mapper.ASC { ra = getDocProp(da, order.FieldIndexes) @@ -133,14 +133,14 @@ func (n *valuesNode) Len() int { // case of nested objects. The key delimeter is a ".". // Eg. // prop = "author.name" -> {author: {name: ...}} -func getDocProp(obj core.Doc, prop []int) interface{} { +func getDocProp(obj core.Doc, prop []int) any { if len(prop) == 0 { return nil } return getMapPropList(obj, prop) } -func getMapPropList(obj core.Doc, props []int) interface{} { +func getMapPropList(obj core.Doc, props []int) any { if len(props) == 1 { return obj.Fields[props[0]] } diff --git a/query/graphql/schema/generate.go b/query/graphql/schema/generate.go index 33e8f8b623..32561dad1c 100644 --- a/query/graphql/schema/generate.go +++ b/query/graphql/schema/generate.go @@ -80,7 +80,7 @@ func (g *Generator) FromSDL( func (g *Generator) FromAST(ctx context.Context, document *ast.Document) ([]*gql.Object, error) { typeMapBeforeMutation := g.manager.schema.TypeMap() - typesBeforeMutation := make(map[string]interface{}, len(typeMapBeforeMutation)) + typesBeforeMutation := make(map[string]any, len(typeMapBeforeMutation)) for typeName := range typeMapBeforeMutation { typesBeforeMutation[typeName] = struct{}{} diff --git a/tests/bench/fixtures/fixtures.go b/tests/bench/fixtures/fixtures.go index f8062e5061..a0af6a687a 100644 --- a/tests/bench/fixtures/fixtures.go +++ b/tests/bench/fixtures/fixtures.go @@ -22,7 +22,7 @@ import ( ) var ( - registeredFixtures = map[string][]interface{}{ + registeredFixtures = map[string][]any{ "user_simple": {User{}}, } ) @@ -31,7 +31,7 @@ type Generator struct { ctx context.Context schema string - types []interface{} + types []any } func ForSchema(ctx context.Context, schemaName string) Generator { @@ -43,12 +43,12 @@ func ForSchema(ctx context.Context, schemaName string) Generator { } // Types returns the defined types for this fixture set -func (g Generator) Types() []interface{} { +func (g Generator) Types() []any { return g.types } // Type returns type at the given index in the fixture set -func (g Generator) Type(index int) interface{} { +func (g Generator) Type(index int) any { return g.types[index] } @@ -84,7 +84,7 @@ func (g Generator) GenerateDocs() ([]string, error) { // extractGQLFromType extracts a GraphQL SDL definition as a string // from a given type struct -func ExtractGQLFromType(t interface{}) (string, error) { +func ExtractGQLFromType(t any) (string, error) { var buf bytes.Buffer if reflect.TypeOf(t).Kind() != reflect.Struct { diff --git a/tests/bench/query/simple/utils.go b/tests/bench/query/simple/utils.go index 29e44d4a2a..0923f823fd 100644 --- a/tests/bench/query/simple/utils.go +++ b/tests/bench/query/simple/utils.go @@ -75,7 +75,7 @@ func runQueryBenchGetSync( } // leave comments for debug!! - // l := len(res.Data.([]map[string]interface{})) + // l := len(res.Data.([]map[string]any)) // if l != opCount { // return fmt.Errorf( // "Invalid response, returned data doesn't match length, expected %v actual %v", diff --git a/tests/integration/mutation/inline_array/update/simple_test.go b/tests/integration/mutation/inline_array/update/simple_test.go index 7419c11eba..0a8e29e6d9 100644 --- a/tests/integration/mutation/inline_array/update/simple_test.go +++ b/tests/integration/mutation/inline_array/update/simple_test.go @@ -36,7 +36,7 @@ func TestMutationInlineArrayUpdateWithBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "LikedIndexes": nil, @@ -59,7 +59,7 @@ func TestMutationInlineArrayUpdateWithBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "LikedIndexes": []bool{}, @@ -82,7 +82,7 @@ func TestMutationInlineArrayUpdateWithBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "LikedIndexes": []bool{true, false, true, false}, @@ -105,7 +105,7 @@ func TestMutationInlineArrayUpdateWithBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "LikedIndexes": []bool{false, true}, @@ -128,7 +128,7 @@ func TestMutationInlineArrayUpdateWithBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "LikedIndexes": []bool{true, false, true, false, true, true}, @@ -159,7 +159,7 @@ func TestMutationInlineArrayWithNillableBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "IndexLikesDislikes": []Option[bool]{Some(true), Some(true), Some(false), Some(true), None[bool]()}, @@ -188,7 +188,7 @@ func TestMutationInlineArrayUpdateWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": nil, @@ -211,7 +211,7 @@ func TestMutationInlineArrayUpdateWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": []int64{}, @@ -234,7 +234,7 @@ func TestMutationInlineArrayUpdateWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": []int64{8, 5, 3, 2, 1}, @@ -257,7 +257,7 @@ func TestMutationInlineArrayUpdateWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": []int64{-1, 2, -3, 5, -8}, @@ -280,7 +280,7 @@ func TestMutationInlineArrayUpdateWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": []int64{1, 2, 3}, @@ -303,7 +303,7 @@ func TestMutationInlineArrayUpdateWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": []int64{1, 2, 3, 5, 8, 13, 21}, @@ -334,7 +334,7 @@ func TestMutationInlineArrayWithNillableInts(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "TestScores": []Option[int64]{None[int64](), Some[int64](2), Some[int64](3), None[int64](), Some[int64](8)}, @@ -363,7 +363,7 @@ func TestMutationInlineArrayUpdateWithFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteFloats": nil, @@ -386,7 +386,7 @@ func TestMutationInlineArrayUpdateWithFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteFloats": []float64{}, @@ -409,7 +409,7 @@ func TestMutationInlineArrayUpdateWithFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteFloats": []float64{3.1425, -0.00000000001, 1000000}, @@ -432,7 +432,7 @@ func TestMutationInlineArrayUpdateWithFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteFloats": []float64{3.14}, @@ -455,7 +455,7 @@ func TestMutationInlineArrayUpdateWithFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteFloats": []float64{3.1425, 0.00000000001, -10, 6.626070}, @@ -486,7 +486,7 @@ func TestMutationInlineArrayWithNillableFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PageRatings": []Option[float64]{Some(3.1425), Some(-0.00000000001), None[float64](), Some[float64](10)}, @@ -515,7 +515,7 @@ func TestMutationInlineArrayUpdateWithStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PreferredStrings": nil, @@ -538,7 +538,7 @@ func TestMutationInlineArrayUpdateWithStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PreferredStrings": []string{}, @@ -561,7 +561,7 @@ func TestMutationInlineArrayUpdateWithStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PreferredStrings": []string{"", "the previous", "the first", "null string"}, @@ -584,7 +584,7 @@ func TestMutationInlineArrayUpdateWithStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PreferredStrings": []string{"", "the first"}, @@ -607,7 +607,7 @@ func TestMutationInlineArrayUpdateWithStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PreferredStrings": []string{ @@ -645,7 +645,7 @@ func TestMutationInlineArrayWithNillableStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PageHeaders": []Option[string]{Some(""), Some("the previous"), None[string](), Some("empty string"), Some("blank string"), Some("hitchi")}, diff --git a/tests/integration/mutation/relation/delete/explain_delete_test.go b/tests/integration/mutation/relation/delete/explain_delete_test.go index bded858758..7fa5d6bbf1 100644 --- a/tests/integration/mutation/relation/delete/explain_delete_test.go +++ b/tests/integration/mutation/relation/delete/explain_delete_test.go @@ -17,7 +17,7 @@ import ( relationTests "github.com/sourcenetwork/defradb/tests/integration/mutation/relation" ) -type dataMap = map[string]interface{} +type dataMap = map[string]any func TestExplainRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { tests := []testUtils.QueryTestCase{ diff --git a/tests/integration/mutation/relation/delete/single_id_test.go b/tests/integration/mutation/relation/delete/single_id_test.go index 036cae2c19..6007993a3a 100644 --- a/tests/integration/mutation/relation/delete/single_id_test.go +++ b/tests/integration/mutation/relation/delete/single_id_test.go @@ -56,7 +56,7 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-2f80f359-535d-508e-ba58-088a309ce3c3", }, @@ -100,7 +100,7 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "AliasOfKey": "bae-2f80f359-535d-508e-ba58-088a309ce3c3", }, @@ -163,7 +163,7 @@ func TestRelationalDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Key": "bae-2f80f359-535d-508e-ba58-088a309ce3c3", }, diff --git a/tests/integration/mutation/simple/create/explain_simple_create_test.go b/tests/integration/mutation/simple/create/explain_simple_create_test.go index e0724fc944..0116243263 100644 --- a/tests/integration/mutation/simple/create/explain_simple_create_test.go +++ b/tests/integration/mutation/simple/create/explain_simple_create_test.go @@ -17,7 +17,7 @@ import ( simpleTests "github.com/sourcenetwork/defradb/tests/integration/mutation/simple" ) -type dataMap = map[string]interface{} +type dataMap = map[string]any func TestExplainMutationCreateSimple(t *testing.T) { test := testUtils.QueryTestCase{ diff --git a/tests/integration/mutation/simple/create/simple_test.go b/tests/integration/mutation/simple/create/simple_test.go index 41a769cc5b..e370f047df 100644 --- a/tests/integration/mutation/simple/create/simple_test.go +++ b/tests/integration/mutation/simple/create/simple_test.go @@ -27,7 +27,7 @@ func TestMutationCreateSimple(t *testing.T) { age } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-0a24cf29-b2c2-5861-9d00-abd6250c475d", "age": uint64(27), diff --git a/tests/integration/mutation/simple/create/with_version_test.go b/tests/integration/mutation/simple/create/with_version_test.go index 59585310bb..6bfe10a8b1 100644 --- a/tests/integration/mutation/simple/create/with_version_test.go +++ b/tests/integration/mutation/simple/create/with_version_test.go @@ -27,9 +27,9 @@ func TestMutationCreateSimpleReturnVersionCID(t *testing.T) { } } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { - "_version": []map[string]interface{}{ + "_version": []map[string]any{ { "cid": "bafybeihsaeu7o2kep75fadotbqurrvqnamkjqr6cnpyvxxb3iolzxvzxve", }, diff --git a/tests/integration/mutation/simple/delete/explain_simple_delete_test.go b/tests/integration/mutation/simple/delete/explain_simple_delete_test.go index 9e9835fb9d..75cb71194f 100644 --- a/tests/integration/mutation/simple/delete/explain_simple_delete_test.go +++ b/tests/integration/mutation/simple/delete/explain_simple_delete_test.go @@ -17,7 +17,7 @@ import ( simpleTests "github.com/sourcenetwork/defradb/tests/integration/mutation/simple" ) -type dataMap = map[string]interface{} +type dataMap = map[string]any func TestExplainDeletionUsingMultiAndSingleIDs_Success(t *testing.T) { tests := []testUtils.QueryTestCase{ @@ -385,7 +385,7 @@ func TestExplainDeletionOfDocumentsWithFilter_Success(t *testing.T) { "explain": dataMap{ "deleteNode": dataMap{ "filter": dataMap{ - "_and": []interface{}{ + "_and": []any{ dataMap{ "age": dataMap{ "_lt": int64(26), @@ -406,7 +406,7 @@ func TestExplainDeletionOfDocumentsWithFilter_Success(t *testing.T) { "collectionID": "1", "collectionName": "user", "filter": dataMap{ - "_and": []interface{}{ + "_and": []any{ dataMap{ "age": dataMap{ "_lt": int64(26), @@ -650,7 +650,7 @@ func TestExplainDeletionUsingMultiIdsAndSingleIdAndFilter_Failure(t *testing.T) "explain": dataMap{ "deleteNode": dataMap{ "filter": dataMap{ - "_and": []interface{}{ + "_and": []any{ dataMap{ "age": dataMap{ "_lt": int64(26), @@ -674,7 +674,7 @@ func TestExplainDeletionUsingMultiIdsAndSingleIdAndFilter_Failure(t *testing.T) "collectionID": "1", "collectionName": "user", "filter": dataMap{ - "_and": []interface{}{ + "_and": []any{ dataMap{ "age": dataMap{ "_lt": int64(26), diff --git a/tests/integration/mutation/simple/delete/multi_ids_test.go b/tests/integration/mutation/simple/delete/multi_ids_test.go index 42a783dbce..199e35baa7 100644 --- a/tests/integration/mutation/simple/delete/multi_ids_test.go +++ b/tests/integration/mutation/simple/delete/multi_ids_test.go @@ -40,7 +40,7 @@ func TestDeletionOfMultipleDocumentUsingMultipleKeys_Success(t *testing.T) { _key } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-6a6482a8-24e1-5c73-a237-ca569e41507d", }, @@ -53,7 +53,7 @@ func TestDeletionOfMultipleDocumentUsingMultipleKeys_Success(t *testing.T) { _key } }`, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, }, // Map store does not support transactions @@ -83,7 +83,7 @@ func TestDeletionOfMultipleDocumentUsingMultipleKeys_Success(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-3a1a496e-24eb-5ae3-9c17-524c146a393e", }, @@ -117,7 +117,7 @@ func TestDeletionOfMultipleDocumentUsingMultipleKeys_Success(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "AliasKey": "bae-3a1a496e-24eb-5ae3-9c17-524c146a393e", }, @@ -162,7 +162,7 @@ func TestDeletionOfMultipleDocumentUsingMultipleKeys_Success(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "AliasKey": "bae-3a1a496e-24eb-5ae3-9c17-524c146a393e", }, @@ -197,7 +197,7 @@ func TestDeleteWithEmptyIdsSet(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } simpleTests.ExecuteTestCase(t, test) } @@ -210,7 +210,7 @@ func TestDeleteWithSingleUnknownIds(t *testing.T) { _key } }`, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } simpleTests.ExecuteTestCase(t, test) } @@ -223,7 +223,7 @@ func TestDeleteWithMultipleUnknownIds(t *testing.T) { _key } }`, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } simpleTests.ExecuteTestCase(t, test) } @@ -246,7 +246,7 @@ func TestDeleteWithUnknownAndKnownIds(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-6a6482a8-24e1-5c73-a237-ca569e41507d", }, @@ -273,7 +273,7 @@ func TestDeleteWithKnownIdsAndEmptyFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-6a6482a8-24e1-5c73-a237-ca569e41507d", }, @@ -305,7 +305,7 @@ func TestDeletionOfMultipleDocumentUsingMultipleKeys_Failure(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, ExpectedError: "[Field \"delete_user\" of type \"[user]\" must have a sub selection.]", }, @@ -331,7 +331,7 @@ func TestDeletionOfMultipleDocumentUsingMultipleKeys_Failure(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, ExpectedError: "Syntax Error GraphQL request (2:114) Unexpected empty IN {}\n\n1: mutation {\n2: \\u0009\\u0009\\u0009\\u0009\\u0009\\u0009delete_user(ids: [\"bae-6a6482a8-24e1-5c73-a237-ca569e41507d\", \"bae-3a1a496e-24eb-5ae3-9c17-524c146a393e\"]) {\n ^\n3: \\u0009\\u0009\\u0009\\u0009\\u0009\\u0009}\n", }, } diff --git a/tests/integration/mutation/simple/delete/single_id_test.go b/tests/integration/mutation/simple/delete/single_id_test.go index 0d3d51a3a0..8f752bee8b 100644 --- a/tests/integration/mutation/simple/delete/single_id_test.go +++ b/tests/integration/mutation/simple/delete/single_id_test.go @@ -40,7 +40,7 @@ func TestDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { _key } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-8ca944fd-260e-5a44-b88f-326d9faca810", }, @@ -55,7 +55,7 @@ func TestDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { }`, // explicitly empty - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, }, @@ -81,7 +81,7 @@ func TestDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "FancyKey": "bae-8ca944fd-260e-5a44-b88f-326d9faca810", }, @@ -116,7 +116,7 @@ func TestDeletionOfADocumentUsingSingleKey_Success(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "MyTestKey": "bae-8ca944fd-260e-5a44-b88f-326d9faca810", }, @@ -139,7 +139,7 @@ func TestDeleteWithUnknownIdEmptyCollection(t *testing.T) { } }`, Docs: map[int][]string{}, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } simpleTests.ExecuteTestCase(t, test) } @@ -162,7 +162,7 @@ func TestDeleteWithUnknownId(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } simpleTests.ExecuteTestCase(t, test) } @@ -184,7 +184,7 @@ func TestDeletionOfADocumentUsingSingleKey_Failure(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, ExpectedError: "[Field \"delete_user\" of type \"[user]\" must have a sub selection.]", }, @@ -204,7 +204,7 @@ func TestDeletionOfADocumentUsingSingleKey_Failure(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, ExpectedError: "Syntax Error GraphQL request (2:67) Unexpected empty IN {}\n\n1: mutation {\n2: \\u0009\\u0009\\u0009\\u0009\\u0009\\u0009delete_user(id: \"bae-8ca944fd-260e-5a44-b88f-326d9faca810\") {\n ^\n3: \\u0009\\u0009\\u0009\\u0009\\u0009\\u0009}\n", }, } diff --git a/tests/integration/mutation/simple/delete/with_filter_test.go b/tests/integration/mutation/simple/delete/with_filter_test.go index 6c7729b519..cd871b5bea 100644 --- a/tests/integration/mutation/simple/delete/with_filter_test.go +++ b/tests/integration/mutation/simple/delete/with_filter_test.go @@ -40,7 +40,7 @@ func TestDeletionOfDocumentsWithFilter_Success(t *testing.T) { }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-6a6482a8-24e1-5c73-a237-ca569e41507d", }, @@ -92,7 +92,7 @@ func TestDeletionOfDocumentsWithFilter_Success(t *testing.T) { }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-4b5b1765-560c-5843-9abc-24d21d8aa598", }, @@ -159,7 +159,7 @@ func TestDeletionOfDocumentsWithFilter_Success(t *testing.T) { }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "DeletedKeyByFilter": "bae-4b5b1765-560c-5843-9abc-24d21d8aa598", }, @@ -218,7 +218,7 @@ func TestDeletionOfDocumentsWithFilter_Success(t *testing.T) { }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "DeletedKeyByFilter": "bae-3a1a496e-24eb-5ae3-9c17-524c146a393e", }, @@ -267,7 +267,7 @@ func TestDeletionOfDocumentsWithFilter_Failure(t *testing.T) { }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, ExpectedError: "", }, @@ -283,7 +283,7 @@ func TestDeletionOfDocumentsWithFilter_Failure(t *testing.T) { Docs: map[int][]string{}, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, ExpectedError: "", }, @@ -312,7 +312,7 @@ func TestDeletionOfDocumentsWithFilter_Failure(t *testing.T) { }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, ExpectedError: "[Field \"delete_user\" of type \"[user]\" must have a sub selection.]", }, @@ -342,7 +342,7 @@ func TestDeletionOfDocumentsWithFilter_Failure(t *testing.T) { }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, ExpectedError: "Syntax Error GraphQL request (2:53) Unexpected empty IN {}\n\n1: mutation {\n2: \\u0009\\u0009\\u0009\\u0009\\u0009\\u0009delete_user(filter: {name: {_eq: \"Shahzad\"}}) {\n ^\n3: \\u0009\\u0009\\u0009\\u0009\\u0009\\u0009}\n", }, diff --git a/tests/integration/mutation/simple/mix/with_txn_test.go b/tests/integration/mutation/simple/mix/with_txn_test.go index 8259f3b3b5..301fa9dc3f 100644 --- a/tests/integration/mutation/simple/mix/with_txn_test.go +++ b/tests/integration/mutation/simple/mix/with_txn_test.go @@ -28,7 +28,7 @@ func TestMutationWithTxnDeletesUserGivenSameTransaction(t *testing.T) { _key } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", }, @@ -41,7 +41,7 @@ func TestMutationWithTxnDeletesUserGivenSameTransaction(t *testing.T) { _key } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", }, @@ -66,7 +66,7 @@ func TestMutationWithTxnDoesNotDeletesUserGivenDifferentTransactions(t *testing. _key } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", }, @@ -79,7 +79,7 @@ func TestMutationWithTxnDoesNotDeletesUserGivenDifferentTransactions(t *testing. _key } }`, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, { TransactionId: 0, @@ -90,7 +90,7 @@ func TestMutationWithTxnDoesNotDeletesUserGivenDifferentTransactions(t *testing. age } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", "name": "John", @@ -107,7 +107,7 @@ func TestMutationWithTxnDoesNotDeletesUserGivenDifferentTransactions(t *testing. age } }`, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, }, // Map store does not support transactions @@ -136,7 +136,7 @@ func TestMutationWithTxnDoesUpdateUserGivenSameTransactions(t *testing.T) { _key } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", }, @@ -151,7 +151,7 @@ func TestMutationWithTxnDoesUpdateUserGivenSameTransactions(t *testing.T) { age } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", "name": "John", @@ -188,7 +188,7 @@ func TestMutationWithTxnDoesNotUpdateUserGivenDifferentTransactions(t *testing.T age } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", "name": "John", @@ -205,7 +205,7 @@ func TestMutationWithTxnDoesNotUpdateUserGivenDifferentTransactions(t *testing.T age } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", "name": "John", @@ -242,7 +242,7 @@ func TestMutationWithTxnDoesNotAllowUpdateInSecondTransactionUser(t *testing.T) age } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", "name": "John", @@ -259,7 +259,7 @@ func TestMutationWithTxnDoesNotAllowUpdateInSecondTransactionUser(t *testing.T) age } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", "name": "John", @@ -277,7 +277,7 @@ func TestMutationWithTxnDoesNotAllowUpdateInSecondTransactionUser(t *testing.T) age } }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-88b63198-7d38-5714-a9ff-21ba46374fd1", "name": "John", diff --git a/tests/integration/mutation/simple/update/explain_simple_update_test.go b/tests/integration/mutation/simple/update/explain_simple_update_test.go index b237a52f33..481ac814a0 100644 --- a/tests/integration/mutation/simple/update/explain_simple_update_test.go +++ b/tests/integration/mutation/simple/update/explain_simple_update_test.go @@ -17,7 +17,7 @@ import ( simpleTests "github.com/sourcenetwork/defradb/tests/integration/mutation/simple" ) -type dataMap = map[string]interface{} +type dataMap = map[string]any func TestExplainSimpleMutationUpdateWithBooleanFilter(t *testing.T) { tests := []testUtils.QueryTestCase{ diff --git a/tests/integration/mutation/simple/update/with_filter_test.go b/tests/integration/mutation/simple/update/with_filter_test.go index 465a6c5bec..115b14990f 100644 --- a/tests/integration/mutation/simple/update/with_filter_test.go +++ b/tests/integration/mutation/simple/update/with_filter_test.go @@ -38,7 +38,7 @@ func TestSimpleMutationUpdateWithBooleanFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-0a24cf29-b2c2-5861-9d00-abd6250c475d", "name": "John", @@ -71,7 +71,7 @@ func TestSimpleMutationUpdateWithBooleanFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-0a24cf29-b2c2-5861-9d00-abd6250c475d", "name": "John", @@ -104,7 +104,7 @@ func TestSimpleMutationUpdateWithBooleanFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-0a24cf29-b2c2-5861-9d00-abd6250c475d", "name": "John", @@ -150,7 +150,7 @@ func TestSimpleMutationUpdateWithIdInFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-0a24cf29-b2c2-5861-9d00-abd6250c475d", "name": "John", @@ -193,7 +193,7 @@ func TestSimpleMutationUpdateWithIdEqualsFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-0a24cf29-b2c2-5861-9d00-abd6250c475d", "name": "John", diff --git a/tests/integration/net/tcp_test.go b/tests/integration/net/tcp_test.go index cb3bfb3400..c4e9aadfda 100644 --- a/tests/integration/net/tcp_test.go +++ b/tests/integration/net/tcp_test.go @@ -50,7 +50,7 @@ func TestP2PWithSingleDocumentUpdatePerNode(t *testing.T) { }, }, }, - Results: map[int]map[int]map[string]interface{}{ + Results: map[int]map[int]map[string]any{ 0: { 0: { "Age": uint64(45), @@ -113,7 +113,7 @@ func TestP2PWithMultipleDocumentUpdatesPerNode(t *testing.T) { }, }, }, - Results: map[int]map[int]map[string]interface{}{ + Results: map[int]map[int]map[string]any{ 0: { 0: { "Age": uint64(47), diff --git a/tests/integration/net/utils.go b/tests/integration/net/utils.go index dbb59c360a..2e3b370aa9 100644 --- a/tests/integration/net/utils.go +++ b/tests/integration/net/utils.go @@ -64,7 +64,7 @@ type P2PTestCase struct { // node/dockey/values Updates map[int]map[int][]string - Results map[int]map[int]map[string]interface{} + Results map[int]map[int]map[string]any } func setupDefraNode(t *testing.T, cfg *config.Config, seeds []string) (*node.Node, []client.DocKey, error) { diff --git a/tests/integration/query/all_commits/with_dockey_count_test.go b/tests/integration/query/all_commits/with_dockey_count_test.go index 27f3801408..84303adfc5 100644 --- a/tests/integration/query/all_commits/with_dockey_count_test.go +++ b/tests/integration/query/all_commits/with_dockey_count_test.go @@ -33,7 +33,7 @@ func TestQueryAllCommitsWithDockeyAndLinkCount(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", "_count": 2, diff --git a/tests/integration/query/all_commits/with_dockey_field_test.go b/tests/integration/query/all_commits/with_dockey_field_test.go index d612d5e399..68f89897fd 100644 --- a/tests/integration/query/all_commits/with_dockey_field_test.go +++ b/tests/integration/query/all_commits/with_dockey_field_test.go @@ -32,7 +32,7 @@ func TestQueryAllCommitsWithDockeyAndUnknownField(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) @@ -54,7 +54,7 @@ func TestQueryAllCommitsWithDockeyAndUnknownFieldId(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) @@ -78,7 +78,7 @@ func TestQueryAllCommitsWithDockeyAndField(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) @@ -102,7 +102,7 @@ func TestQueryAllCommitsWithDockeyAndFieldId(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", }, diff --git a/tests/integration/query/all_commits/with_dockey_test.go b/tests/integration/query/all_commits/with_dockey_test.go index 9a4b796186..76f0c70361 100644 --- a/tests/integration/query/all_commits/with_dockey_test.go +++ b/tests/integration/query/all_commits/with_dockey_test.go @@ -32,7 +32,7 @@ func TestQueryAllCommitsWithUnknownDockey(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) @@ -54,7 +54,7 @@ func TestQueryAllCommitsWithDockey(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", }, @@ -84,10 +84,10 @@ func TestQueryAllCommitsWithDockeyAndLinks(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", - "links": []map[string]interface{}{ + "links": []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", "name": "Age", @@ -130,7 +130,7 @@ func TestQueryAllCommitsWithDockeyAndUpdate(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeibrbfg35mwggcj4vnskak4qn45hp7fy5a4zp2n34sbq5vt5utr6pq", "height": int64(2), @@ -177,10 +177,10 @@ func TestQueryAllCommitsWithDockeyAndUpdateAndLinks(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeibrbfg35mwggcj4vnskak4qn45hp7fy5a4zp2n34sbq5vt5utr6pq", - "links": []map[string]interface{}{ + "links": []map[string]any{ { "cid": "bafybeicvef4ugls2dl7j4hibt2ahxss2i2i4bbgps7tkjiaoybp6q73mca", "name": "Age", @@ -193,7 +193,7 @@ func TestQueryAllCommitsWithDockeyAndUpdateAndLinks(t *testing.T) { }, { "cid": "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", - "links": []map[string]interface{}{ + "links": []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", "name": "Age", diff --git a/tests/integration/query/commit/with_cid_test.go b/tests/integration/query/commit/with_cid_test.go index 032e3ce76e..2eb2d0fa56 100644 --- a/tests/integration/query/commit/with_cid_test.go +++ b/tests/integration/query/commit/with_cid_test.go @@ -112,7 +112,7 @@ func TestQueryOneCommitWithCid(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", "height": int64(1), @@ -164,7 +164,7 @@ func TestQueryOneCommitWithCidAndLinks(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", "height": int64(1), @@ -187,7 +187,7 @@ func TestQueryOneCommitWithCidAndLinks(t *testing.T) { 0x68, 0x6e, }, - "links": []map[string]interface{}{ + "links": []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", "name": "Age", diff --git a/tests/integration/query/complex/simple_test.go b/tests/integration/query/complex/simple_test.go index e83801e435..937dd992e2 100644 --- a/tests/integration/query/complex/simple_test.go +++ b/tests/integration/query/complex/simple_test.go @@ -59,13 +59,13 @@ func TestQueryComplex(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "The Coffee Table Book", - "author": map[string]interface{}{ + "author": map[string]any{ "name": "Cosmo Kramer", }, - "publisher": map[string]interface{}{ + "publisher": map[string]any{ "name": "Pendant Publishing", }, }, diff --git a/tests/integration/query/complex/with_filter_test.go b/tests/integration/query/complex/with_filter_test.go index d5b19a7483..3d8437d315 100644 --- a/tests/integration/query/complex/with_filter_test.go +++ b/tests/integration/query/complex/with_filter_test.go @@ -55,12 +55,12 @@ func TestQueryComplexWithDeepFilterOnRenderedChildren(t *testing.T) { "address": "600 Madison Ave., New York, New York" }`)}, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Pendant Publishing", - "published": []map[string]interface{}{ + "published": []map[string]any{ { - "author": map[string]interface{}{ + "author": map[string]any{ "age": uint64(44), }, }, diff --git a/tests/integration/query/complex/with_sum_test.go b/tests/integration/query/complex/with_sum_test.go index 318b2667ad..cf16e3841b 100644 --- a/tests/integration/query/complex/with_sum_test.go +++ b/tests/integration/query/complex/with_sum_test.go @@ -42,7 +42,7 @@ func TestQueryComplexWithSumOnInlineAndManyToMany(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Pendant Publishing", "ThisMakesNoSenseToSumButHey": int64(1), diff --git a/tests/integration/query/explain/utils.go b/tests/integration/query/explain/utils.go index e7f8ec2cff..9d921af82c 100644 --- a/tests/integration/query/explain/utils.go +++ b/tests/integration/query/explain/utils.go @@ -16,7 +16,7 @@ import ( testUtils "github.com/sourcenetwork/defradb/tests/integration" ) -type dataMap = map[string]interface{} +type dataMap = map[string]any var bookAuthorGQLSchema = (` type article { diff --git a/tests/integration/query/inline_array/simple_test.go b/tests/integration/query/inline_array/simple_test.go index fce849d285..a80419fa98 100644 --- a/tests/integration/query/inline_array/simple_test.go +++ b/tests/integration/query/inline_array/simple_test.go @@ -35,7 +35,7 @@ func TestQueryInlineArrayWithBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "LikedIndexes": nil, @@ -58,7 +58,7 @@ func TestQueryInlineArrayWithBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "LikedIndexes": []bool{}, @@ -81,7 +81,7 @@ func TestQueryInlineArrayWithBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "LikedIndexes": []bool{true, true, false, true}, @@ -112,7 +112,7 @@ func TestQueryInlineArrayWithNillableBooleans(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "IndexLikesDislikes": []Option[bool]{Some(true), Some(true), Some(false), None[bool]()}, @@ -140,7 +140,7 @@ func TestQueryInlineArrayWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": nil, @@ -163,7 +163,7 @@ func TestQueryInlineArrayWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": nil, @@ -186,7 +186,7 @@ func TestQueryInlineArrayWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": []int64{}, @@ -209,7 +209,7 @@ func TestQueryInlineArrayWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteIntegers": []int64{1, 2, 3, 5, 8}, @@ -232,7 +232,7 @@ func TestQueryInlineArrayWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Andy", "FavouriteIntegers": []int64{-1, -2, -3, -5, -8}, @@ -255,7 +255,7 @@ func TestQueryInlineArrayWithIntegers(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "FavouriteIntegers": []int64{-1, 2, -1, 1, 0}, @@ -286,7 +286,7 @@ func TestQueryInlineArrayWithNillableInts(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "TestScores": []Option[int64]{Some[int64](-1), None[int64](), Some[int64](-1), Some[int64](2), Some[int64](0)}, @@ -315,7 +315,7 @@ func TestQueryInlineArrayWithFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteFloats": nil, @@ -338,7 +338,7 @@ func TestQueryInlineArrayWithFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteFloats": []float64{}, @@ -361,7 +361,7 @@ func TestQueryInlineArrayWithFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "FavouriteFloats": []float64{3.1425, 0.00000000001, 10}, @@ -392,7 +392,7 @@ func TestQueryInlineArrayWithNillableFloats(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PageRatings": []Option[float64]{Some(3.1425), None[float64](), Some(-0.00000000001), Some[float64](10)}, @@ -421,7 +421,7 @@ func TestQueryInlineArrayWithStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PreferredStrings": nil, @@ -444,7 +444,7 @@ func TestQueryInlineArrayWithStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PreferredStrings": []string{}, @@ -467,7 +467,7 @@ func TestQueryInlineArrayWithStrings(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PreferredStrings": []string{"", "the previous", "the first", "empty string"}, @@ -498,7 +498,7 @@ func TestQueryInlineArrayWithNillableString(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "PageHeaders": []Option[string]{Some(""), Some("the previous"), Some("the first"), Some("empty string"), None[string]()}, diff --git a/tests/integration/query/inline_array/with_average_filter_test.go b/tests/integration/query/inline_array/with_average_filter_test.go index f4f6b714e9..6bce49f534 100644 --- a/tests/integration/query/inline_array/with_average_filter_test.go +++ b/tests/integration/query/inline_array/with_average_filter_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithAverageWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_avg": float64(1.5), @@ -61,7 +61,7 @@ func TestQueryInlineNillableIntegerArrayWithAverageWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(6.5), @@ -89,7 +89,7 @@ func TestQueryInlineFloatArrayWithAverageWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_avg": 3.5, @@ -117,7 +117,7 @@ func TestQueryInlineNillableFloatArrayWithAverageWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_avg": 3.5, diff --git a/tests/integration/query/inline_array/with_average_sum_test.go b/tests/integration/query/inline_array/with_average_sum_test.go index 724c8c15b2..624f09227f 100644 --- a/tests/integration/query/inline_array/with_average_sum_test.go +++ b/tests/integration/query/inline_array/with_average_sum_test.go @@ -38,7 +38,7 @@ func TestQueryInlineIntegerArrayWithAverageAndSum(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(2), diff --git a/tests/integration/query/inline_array/with_average_test.go b/tests/integration/query/inline_array/with_average_test.go index c47b7fee55..e19195dca7 100644 --- a/tests/integration/query/inline_array/with_average_test.go +++ b/tests/integration/query/inline_array/with_average_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithAverageAndNullArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(0), @@ -61,7 +61,7 @@ func TestQueryInlineIntegerArrayWithAverageAndEmptyArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(0), @@ -89,7 +89,7 @@ func TestQueryInlineIntegerArrayWithAverageAndZeroArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(0), @@ -117,7 +117,7 @@ func TestQueryInlineIntegerArrayWithAverageAndPopulatedArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(2), @@ -145,7 +145,7 @@ func TestQueryInlineNillableIntegerArrayWithAverageAndPopulatedArray(t *testing. }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(4), @@ -173,7 +173,7 @@ func TestQueryInlineFloatArrayWithAverageAndNullArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(0), @@ -201,7 +201,7 @@ func TestQueryInlineFloatArrayWithAverageAndEmptyArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(0), @@ -229,7 +229,7 @@ func TestQueryInlineFloatArrayWithAverageAndZeroArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(0), @@ -257,7 +257,7 @@ func TestQueryInlineFloatArrayWithAverageAndPopulatedArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(0.2), @@ -285,7 +285,7 @@ func TestQueryInlineNillableFloatArrayWithAverageAndPopulatedArray(t *testing.T) }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(0.2), diff --git a/tests/integration/query/inline_array/with_count_filter_test.go b/tests/integration/query/inline_array/with_count_filter_test.go index 2ee217c61a..399237eab2 100644 --- a/tests/integration/query/inline_array/with_count_filter_test.go +++ b/tests/integration/query/inline_array/with_count_filter_test.go @@ -33,7 +33,7 @@ func TestQueryInlineBoolArrayWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 3, @@ -61,7 +61,7 @@ func TestQueryInlineNillableBoolArrayWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_count": 2, @@ -89,7 +89,7 @@ func TestQueryInlineIntegerArrayWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 2, @@ -117,7 +117,7 @@ func TestQueryInlineNillableIntegerArrayWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 2, @@ -144,7 +144,7 @@ func TestQueryInlineIntegerArrayWithsWithCountWithAndFilterAndPopulatedArray(t * "FavouriteIntegers": [-1, 2, -1, 1, 0, -2] }`)}, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 4, @@ -172,7 +172,7 @@ func TestQueryInlineFloatArrayWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 2, @@ -200,7 +200,7 @@ func TestQueryInlineNillableFloatArrayWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 2, @@ -228,7 +228,7 @@ func TestQueryInlineStringArrayWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 2, @@ -256,7 +256,7 @@ func TestQueryInlineNillableStringArrayWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 2, diff --git a/tests/integration/query/inline_array/with_count_limit_offset_test.go b/tests/integration/query/inline_array/with_count_limit_offset_test.go index 5c62d7804d..c7a968f919 100644 --- a/tests/integration/query/inline_array/with_count_limit_offset_test.go +++ b/tests/integration/query/inline_array/with_count_limit_offset_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithCountWithOffsetWithLimitGreaterThanLength(t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 2, @@ -61,7 +61,7 @@ func TestQueryInlineIntegerArrayWithCountWithOffsetWithLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 3, diff --git a/tests/integration/query/inline_array/with_count_limit_test.go b/tests/integration/query/inline_array/with_count_limit_test.go index 03df0733b5..9352af4898 100644 --- a/tests/integration/query/inline_array/with_count_limit_test.go +++ b/tests/integration/query/inline_array/with_count_limit_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithCountWithLimitGreaterThanLength(t *testing.T }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 2, @@ -61,7 +61,7 @@ func TestQueryInlineIntegerArrayWithCountWithLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 3, diff --git a/tests/integration/query/inline_array/with_count_test.go b/tests/integration/query/inline_array/with_count_test.go index b835959918..979b54ef9c 100644 --- a/tests/integration/query/inline_array/with_count_test.go +++ b/tests/integration/query/inline_array/with_count_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithCountAndNullArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_count": 0, @@ -61,7 +61,7 @@ func TestQueryInlineIntegerArrayWithCountAndEmptyArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_count": 0, @@ -89,7 +89,7 @@ func TestQueryInlineIntegerArrayWithCountAndPopulatedArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_count": 5, @@ -117,7 +117,7 @@ func TestQueryInlineNillableBoolArrayWithCountAndPopulatedArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_count": 4, diff --git a/tests/integration/query/inline_array/with_group_test.go b/tests/integration/query/inline_array/with_group_test.go index 3872695926..345a91cf96 100644 --- a/tests/integration/query/inline_array/with_group_test.go +++ b/tests/integration/query/inline_array/with_group_test.go @@ -39,10 +39,10 @@ func TestQueryInlineArrayWithGroupByString(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "FavouriteIntegers": []int64{-1, 2, -1, 1, 0}, }, @@ -84,10 +84,10 @@ func TestQueryInlineArrayWithGroupByArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "FavouriteIntegers": []int64{-1, 2, -1, 1, 0}, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Shahzad", }, @@ -98,7 +98,7 @@ func TestQueryInlineArrayWithGroupByArray(t *testing.T) { }, { "FavouriteIntegers": []int64{1, 2, 3}, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "John", }, diff --git a/tests/integration/query/inline_array/with_sum_filter_test.go b/tests/integration/query/inline_array/with_sum_filter_test.go index 9ca32d4c86..94e2c7f04c 100644 --- a/tests/integration/query/inline_array/with_sum_filter_test.go +++ b/tests/integration/query/inline_array/with_sum_filter_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithSumWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": int64(3), @@ -61,7 +61,7 @@ func TestQueryInlineNillableIntegerArrayWithSumWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": int64(3), @@ -89,7 +89,7 @@ func TestQueryInlineFloatArrayWithSumWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": 3.14250000001, @@ -117,7 +117,7 @@ func TestQueryInlineNillableFloatArrayWithSumWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": float64(3.14250000001), diff --git a/tests/integration/query/inline_array/with_sum_limit_offset_test.go b/tests/integration/query/inline_array/with_sum_limit_offset_test.go index 54842af570..6c137b1d46 100644 --- a/tests/integration/query/inline_array/with_sum_limit_offset_test.go +++ b/tests/integration/query/inline_array/with_sum_limit_offset_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithSumWithOffsetWithLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": int64(7), diff --git a/tests/integration/query/inline_array/with_sum_limit_test.go b/tests/integration/query/inline_array/with_sum_limit_test.go index 546618191a..df97d575eb 100644 --- a/tests/integration/query/inline_array/with_sum_limit_test.go +++ b/tests/integration/query/inline_array/with_sum_limit_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithSumWithLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": int64(1), diff --git a/tests/integration/query/inline_array/with_sum_test.go b/tests/integration/query/inline_array/with_sum_test.go index 4ca6862dc6..5bf81d38ab 100644 --- a/tests/integration/query/inline_array/with_sum_test.go +++ b/tests/integration/query/inline_array/with_sum_test.go @@ -33,7 +33,7 @@ func TestQueryInlineIntegerArrayWithSumAndNullArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": int64(0), @@ -61,7 +61,7 @@ func TestQueryInlineIntegerArrayWithSumAndEmptyArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": int64(0), @@ -89,7 +89,7 @@ func TestQueryInlineIntegerArrayWithSumAndPopulatedArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": int64(1), @@ -117,7 +117,7 @@ func TestQueryInlineNillableIntegerArrayWithSumAndPopulatedArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": int64(2), @@ -145,7 +145,7 @@ func TestQueryInlineFloatArrayWithSumAndNullArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": float64(0), @@ -173,7 +173,7 @@ func TestQueryInlineFloatArrayWithSumAndEmptyArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": float64(0), @@ -201,7 +201,7 @@ func TestQueryInlineFloatArrayWithSumAndPopulatedArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": float64(13.14250000001), @@ -229,7 +229,7 @@ func TestQueryInlineNillableFloatArrayWithSumAndPopulatedArray(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Shahzad", "_sum": float64(13.14250000001), diff --git a/tests/integration/query/latest_commits/with_dockey_field_test.go b/tests/integration/query/latest_commits/with_dockey_field_test.go index 24630f7938..0dc27c79e4 100644 --- a/tests/integration/query/latest_commits/with_dockey_field_test.go +++ b/tests/integration/query/latest_commits/with_dockey_field_test.go @@ -38,7 +38,7 @@ func TestQueryLatestCommitsWithDocKeyAndFieldName(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) @@ -66,10 +66,10 @@ func TestQueryLatestCommitsWithDocKeyAndFieldId(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", - "links": []map[string]interface{}{}, + "links": []map[string]any{}, }, }, } @@ -99,10 +99,10 @@ func TestQueryLatestCommitsWithDocKeyAndCompositeFieldId(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", - "links": []map[string]interface{}{ + "links": []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", "name": "Age", diff --git a/tests/integration/query/latest_commits/with_dockey_test.go b/tests/integration/query/latest_commits/with_dockey_test.go index 6f5badbd20..d8267e65d0 100644 --- a/tests/integration/query/latest_commits/with_dockey_test.go +++ b/tests/integration/query/latest_commits/with_dockey_test.go @@ -36,10 +36,10 @@ func TestQueryLatestCommitsWithDocKey(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "cid": "bafybeid57gpbwi4i6bg7g357vwwyzsmr4bjo22rmhoxrwqvdxlqxcgaqvu", - "links": []map[string]interface{}{ + "links": []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", "name": "Age", diff --git a/tests/integration/query/one_to_many/simple_test.go b/tests/integration/query/one_to_many/simple_test.go index ed94869df0..5d9e7b9ead 100644 --- a/tests/integration/query/one_to_many/simple_test.go +++ b/tests/integration/query/one_to_many/simple_test.go @@ -48,11 +48,11 @@ func TestQueryOneToMany(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", "age": uint64(65), }, @@ -106,11 +106,11 @@ func TestQueryOneToMany(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Painted House", "rating": 4.9, @@ -124,7 +124,7 @@ func TestQueryOneToMany(t *testing.T) { { "name": "Cornelia Funke", "age": uint64(62), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, diff --git a/tests/integration/query/one_to_many/with_cid_dockey_test.go b/tests/integration/query/one_to_many/with_cid_dockey_test.go index 91d98c3320..e877699571 100644 --- a/tests/integration/query/one_to_many/with_cid_dockey_test.go +++ b/tests/integration/query/one_to_many/with_cid_dockey_test.go @@ -52,10 +52,10 @@ func TestQueryOneToManyWithUnknownCidAndDocKey(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", }, }, @@ -105,10 +105,10 @@ func TestQueryOneToManyWithCidAndDocKey(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", }, }, @@ -164,10 +164,10 @@ func TestQueryOneToManyWithChildUpdateAndFirstCidAndDocKey(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", "age": uint64(22), }, @@ -220,11 +220,11 @@ func TestQueryOneToManyWithParentUpdateAndFirstCidAndDocKey(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": float64(4.9), - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", }, }, @@ -276,11 +276,11 @@ func TestQueryOneToManyWithParentUpdateAndLastCidAndDocKey(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": float64(4.5), - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", }, }, diff --git a/tests/integration/query/one_to_many/with_count_filter_test.go b/tests/integration/query/one_to_many/with_count_filter_test.go index 8ecd34c2cc..12a3a1fd99 100644 --- a/tests/integration/query/one_to_many/with_count_filter_test.go +++ b/tests/integration/query/one_to_many/with_count_filter_test.go @@ -60,7 +60,7 @@ func TestQueryOneToManyWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 1, diff --git a/tests/integration/query/one_to_many/with_count_limit_offset_test.go b/tests/integration/query/one_to_many/with_count_limit_offset_test.go index 54b475f765..57246ae79a 100644 --- a/tests/integration/query/one_to_many/with_count_limit_offset_test.go +++ b/tests/integration/query/one_to_many/with_count_limit_offset_test.go @@ -73,11 +73,11 @@ func TestQueryOneToManyWithCountAndLimitAndOffset(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 4, - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "The Pelican Brief", }, @@ -89,7 +89,7 @@ func TestQueryOneToManyWithCountAndLimitAndOffset(t *testing.T) { { "name": "Cornelia Funke", "_count": 1, - "published": []map[string]interface{}{}, + "published": []map[string]any{}, }, }, } @@ -149,11 +149,11 @@ func TestQueryOneToManyWithCountAndDifferentOffsets(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 2, - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "The Associate", }, @@ -165,7 +165,7 @@ func TestQueryOneToManyWithCountAndDifferentOffsets(t *testing.T) { { "name": "Cornelia Funke", "_count": 0, - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Theif Lord", }, @@ -221,7 +221,7 @@ func TestQueryOneToManyWithCountWithLimitWithOffset(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 1, diff --git a/tests/integration/query/one_to_many/with_count_limit_test.go b/tests/integration/query/one_to_many/with_count_limit_test.go index 23ada4c248..c42ddabfff 100644 --- a/tests/integration/query/one_to_many/with_count_limit_test.go +++ b/tests/integration/query/one_to_many/with_count_limit_test.go @@ -63,11 +63,11 @@ func TestQueryOneToManyWithCountAndLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 2, - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Painted House", }, @@ -76,7 +76,7 @@ func TestQueryOneToManyWithCountAndLimit(t *testing.T) { { "name": "Cornelia Funke", "_count": 1, - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Theif Lord", }, @@ -140,11 +140,11 @@ func TestQueryOneToManyWithCountAndDifferentLimits(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 2, - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "The Associate", }, @@ -153,7 +153,7 @@ func TestQueryOneToManyWithCountAndDifferentLimits(t *testing.T) { { "name": "Cornelia Funke", "_count": 1, - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Theif Lord", }, @@ -209,7 +209,7 @@ func TestQueryOneToManyWithCountWithLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 1, diff --git a/tests/integration/query/one_to_many/with_count_test.go b/tests/integration/query/one_to_many/with_count_test.go index 9c9a6ddfe4..dd5bc4125f 100644 --- a/tests/integration/query/one_to_many/with_count_test.go +++ b/tests/integration/query/one_to_many/with_count_test.go @@ -36,7 +36,7 @@ func TestQueryOneToManyWithCount(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 0, @@ -86,7 +86,7 @@ func TestQueryOneToManyWithCount(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 2, diff --git a/tests/integration/query/one_to_many/with_filter_test.go b/tests/integration/query/one_to_many/with_filter_test.go index 7c5c74e13b..e5d07fdaae 100644 --- a/tests/integration/query/one_to_many/with_filter_test.go +++ b/tests/integration/query/one_to_many/with_filter_test.go @@ -64,11 +64,11 @@ func TestQueryOneToManyWithNumericGreaterThanFilterOnParent(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Painted House", "rating": 4.9, @@ -128,7 +128,7 @@ func TestQueryOneToManyWithNumericGreaterThanChildFilterOnParentWithUnrenderedCh }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", }, @@ -186,11 +186,11 @@ func TestQueryOneToManyWithNumericGreaterThanFilterOnParentAndChild(t *testing.T }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Painted House", "rating": 4.9, @@ -255,17 +255,17 @@ func TestQueryOneToManyWithMultipleAliasedFilteredChildren(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "p1": []map[string]interface{}{ + "p1": []map[string]any{ { "name": "Painted House", "rating": 4.9, }, }, - "p2": []map[string]interface{}{ + "p2": []map[string]any{ { "name": "A Time for Mercy", "rating": 4.5, @@ -275,13 +275,13 @@ func TestQueryOneToManyWithMultipleAliasedFilteredChildren(t *testing.T) { { "name": "Cornelia Funke", "age": uint64(62), - "p1": []map[string]interface{}{ + "p1": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, }, }, - "p2": []map[string]interface{}{}, + "p2": []map[string]any{}, }, }, } diff --git a/tests/integration/query/one_to_many/with_group_filter_test.go b/tests/integration/query/one_to_many/with_group_filter_test.go index 7e4c121446..c504c2aef2 100644 --- a/tests/integration/query/one_to_many/with_group_filter_test.go +++ b/tests/integration/query/one_to_many/with_group_filter_test.go @@ -88,17 +88,17 @@ func TestQueryOneToManyWithParentJoinGroupNumberAndNumberFilterOnJoin(t *testing }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "age": uint64(327), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "Simon Pelloutier", - "published": []map[string]interface{}{}, + "published": []map[string]any{}, }, { "name": "Voltaire", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Candide", "rating": 4.95, @@ -113,10 +113,10 @@ func TestQueryOneToManyWithParentJoinGroupNumberAndNumberFilterOnJoin(t *testing }, { "age": uint64(65), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "John Grisham", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Painted House", "rating": 4.9, @@ -206,13 +206,13 @@ func TestQueryOneToManyWithParentJoinGroupNumberAndNumberFilterOnGroup(t *testin }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "age": uint64(327), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "Voltaire", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Candide", "rating": 4.95, @@ -227,10 +227,10 @@ func TestQueryOneToManyWithParentJoinGroupNumberAndNumberFilterOnGroup(t *testin }, { "age": uint64(65), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "John Grisham", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "The Client", "rating": 4.5, @@ -328,17 +328,17 @@ func TestQueryOneToManyWithParentJoinGroupNumberAndNumberFilterOnGroupAndOnGroup }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "age": uint64(327), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "Simon Pelloutier", - "published": []map[string]interface{}{}, + "published": []map[string]any{}, }, { "name": "Voltaire", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Candide", "rating": 4.95, diff --git a/tests/integration/query/one_to_many/with_group_test.go b/tests/integration/query/one_to_many/with_group_test.go index 0def36eb15..2da288f96f 100644 --- a/tests/integration/query/one_to_many/with_group_test.go +++ b/tests/integration/query/one_to_many/with_group_test.go @@ -72,14 +72,14 @@ func TestQueryOneToManyWithInnerJoinGroupNumber(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "rating": 4.5, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "The Client", }, @@ -90,7 +90,7 @@ func TestQueryOneToManyWithInnerJoinGroupNumber(t *testing.T) { }, { "rating": 4.9, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "Painted House", }, @@ -101,10 +101,10 @@ func TestQueryOneToManyWithInnerJoinGroupNumber(t *testing.T) { { "name": "Cornelia Funke", "age": uint64(62), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "rating": 4.8, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "Theif Lord", }, @@ -193,13 +193,13 @@ func TestQueryOneToManyWithParentJoinGroupNumber(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "age": uint64(327), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "Simon Pelloutier", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Histoiare des Celtes et particulierement des Gaulois et des Germains depuis les temps fabuleux jusqua la prise de Roze par les Gaulois", "rating": float64(2), @@ -208,7 +208,7 @@ func TestQueryOneToManyWithParentJoinGroupNumber(t *testing.T) { }, { "name": "Voltaire", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Candide", "rating": 4.95, @@ -223,10 +223,10 @@ func TestQueryOneToManyWithParentJoinGroupNumber(t *testing.T) { }, { "age": uint64(65), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "name": "John Grisham", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "The Client", "rating": 4.5, diff --git a/tests/integration/query/one_to_many/with_limit_test.go b/tests/integration/query/one_to_many/with_limit_test.go index a32118ff38..a825b31715 100644 --- a/tests/integration/query/one_to_many/with_limit_test.go +++ b/tests/integration/query/one_to_many/with_limit_test.go @@ -63,10 +63,10 @@ func TestQueryOneToManyWithSingleChildLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Painted House", "rating": 4.9, @@ -75,7 +75,7 @@ func TestQueryOneToManyWithSingleChildLimit(t *testing.T) { }, { "name": "Cornelia Funke", - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, @@ -139,16 +139,16 @@ func TestQueryOneToManyWithMultipleChildLimits(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", - "p1": []map[string]interface{}{ + "p1": []map[string]any{ { "name": "Painted House", "rating": 4.9, }, }, - "p2": []map[string]interface{}{ + "p2": []map[string]any{ { "name": "Painted House", "rating": 4.9, @@ -161,13 +161,13 @@ func TestQueryOneToManyWithMultipleChildLimits(t *testing.T) { }, { "name": "Cornelia Funke", - "p1": []map[string]interface{}{ + "p1": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, }, }, - "p2": []map[string]interface{}{ + "p2": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, diff --git a/tests/integration/query/one_to_many/with_order_filter_limit_test.go b/tests/integration/query/one_to_many/with_order_filter_limit_test.go index ca343e2096..89243e17ac 100644 --- a/tests/integration/query/one_to_many/with_order_filter_limit_test.go +++ b/tests/integration/query/one_to_many/with_order_filter_limit_test.go @@ -66,11 +66,11 @@ func TestQueryOneToManyWithNumericGreaterThanFilterOnParentAndNumericSortAscendi }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "A Time for Mercy", "rating": 4.5, diff --git a/tests/integration/query/one_to_many/with_order_filter_test.go b/tests/integration/query/one_to_many/with_order_filter_test.go index c7a2b6f3f1..7f724bde9f 100644 --- a/tests/integration/query/one_to_many/with_order_filter_test.go +++ b/tests/integration/query/one_to_many/with_order_filter_test.go @@ -66,11 +66,11 @@ func TestQueryOneToManyWithNumericGreaterThanFilterOnParentAndNumericSortAscendi }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "A Time for Mercy", "rating": 4.5, @@ -135,11 +135,11 @@ func TestQueryOneToManyWithNumericGreaterThanFilterAndNumericSortDescendingOnChi }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Painted House", "rating": 4.9, @@ -153,7 +153,7 @@ func TestQueryOneToManyWithNumericGreaterThanFilterAndNumericSortDescendingOnChi { "name": "Cornelia Funke", "age": uint64(62), - "published": []map[string]interface{}{ + "published": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, diff --git a/tests/integration/query/one_to_many/with_same_field_name_test.go b/tests/integration/query/one_to_many/with_same_field_name_test.go index 558e320171..6504a2fa34 100644 --- a/tests/integration/query/one_to_many/with_same_field_name_test.go +++ b/tests/integration/query/one_to_many/with_same_field_name_test.go @@ -59,10 +59,10 @@ func TestQueryOneToManyWithSameFieldName(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", - "relationship1": map[string]interface{}{ + "relationship1": map[string]any{ "name": "John Grisham", }, }, @@ -93,10 +93,10 @@ func TestQueryOneToManyWithSameFieldName(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", - "relationship1": []map[string]interface{}{ + "relationship1": []map[string]any{ { "name": "Painted House", }, diff --git a/tests/integration/query/one_to_many/with_sum_limit_offset_test.go b/tests/integration/query/one_to_many/with_sum_limit_offset_test.go index 52fc2badff..57c3367f62 100644 --- a/tests/integration/query/one_to_many/with_sum_limit_offset_test.go +++ b/tests/integration/query/one_to_many/with_sum_limit_offset_test.go @@ -65,7 +65,7 @@ func TestQueryOneToManyWithSumWithLimitAndOffset(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_sum": 9.4, diff --git a/tests/integration/query/one_to_many/with_sum_limit_test.go b/tests/integration/query/one_to_many/with_sum_limit_test.go index 5525495ea3..8b21916e71 100644 --- a/tests/integration/query/one_to_many/with_sum_limit_test.go +++ b/tests/integration/query/one_to_many/with_sum_limit_test.go @@ -65,7 +65,7 @@ func TestQueryOneToManyWithSumWithLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", // .00...1 is float math thing diff --git a/tests/integration/query/one_to_many_multiple/with_average_filter_test.go b/tests/integration/query/one_to_many_multiple/with_average_filter_test.go index e016ae7d1c..74a649358e 100644 --- a/tests/integration/query/one_to_many_multiple/with_average_filter_test.go +++ b/tests/integration/query/one_to_many_multiple/with_average_filter_test.go @@ -83,7 +83,7 @@ func TestQueryOneToManyMultipleWithAverageOnMultipleJoinsWithAndWithoutFilter(t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_avg": float64(3), @@ -165,7 +165,7 @@ func TestQueryOneToManyMultipleWithAverageOnMultipleJoinsWithFilters(t *testing. }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_avg": float64(0), diff --git a/tests/integration/query/one_to_many_multiple/with_average_test.go b/tests/integration/query/one_to_many_multiple/with_average_test.go index 5191c762f5..c5e4ca7539 100644 --- a/tests/integration/query/one_to_many_multiple/with_average_test.go +++ b/tests/integration/query/one_to_many_multiple/with_average_test.go @@ -83,7 +83,7 @@ func TestQueryOneToManyMultipleWithAverageOnMultipleJoins(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_avg": float64(2.25), diff --git a/tests/integration/query/one_to_many_multiple/with_count_filter_test.go b/tests/integration/query/one_to_many_multiple/with_count_filter_test.go index cbe7e28067..f9c15a3302 100644 --- a/tests/integration/query/one_to_many_multiple/with_count_filter_test.go +++ b/tests/integration/query/one_to_many_multiple/with_count_filter_test.go @@ -83,7 +83,7 @@ func TestQueryOneToManyMultipleWithCountOnMultipleJoinsWithAndWithoutFilter(t *t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 1, @@ -165,7 +165,7 @@ func TestQueryOneToManyMultipleWithCountOnMultipleJoinsWithFilters(t *testing.T) }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 0, diff --git a/tests/integration/query/one_to_many_multiple/with_count_test.go b/tests/integration/query/one_to_many_multiple/with_count_test.go index 58b1a4b358..6d226a753f 100644 --- a/tests/integration/query/one_to_many_multiple/with_count_test.go +++ b/tests/integration/query/one_to_many_multiple/with_count_test.go @@ -73,7 +73,7 @@ func TestQueryOneToManyMultipleWithCount(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "numberOfBooks": 2, @@ -150,7 +150,7 @@ func TestQueryOneToManyMultipleWithCountOnMultipleJoins(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_count": 4, diff --git a/tests/integration/query/one_to_many_multiple/with_sum_filter_test.go b/tests/integration/query/one_to_many_multiple/with_sum_filter_test.go index 3490def68e..c17a6ee83c 100644 --- a/tests/integration/query/one_to_many_multiple/with_sum_filter_test.go +++ b/tests/integration/query/one_to_many_multiple/with_sum_filter_test.go @@ -83,7 +83,7 @@ func TestQueryOneToManyMultipleWithSumOnMultipleJoinsWithAndWithoutFilter(t *tes }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_sum": int64(3), @@ -165,7 +165,7 @@ func TestQueryOneToManyMultipleWithSumOnMultipleJoinsWithFilters(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_sum": int64(0), diff --git a/tests/integration/query/one_to_many_multiple/with_sum_test.go b/tests/integration/query/one_to_many_multiple/with_sum_test.go index 4eca048366..f81a020fba 100644 --- a/tests/integration/query/one_to_many_multiple/with_sum_test.go +++ b/tests/integration/query/one_to_many_multiple/with_sum_test.go @@ -83,7 +83,7 @@ func TestQueryOneToManyMultipleWithSumOnMultipleJoins(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "_sum": int64(9), diff --git a/tests/integration/query/one_to_one/simple_test.go b/tests/integration/query/one_to_one/simple_test.go index 955729acfd..a136276bd8 100644 --- a/tests/integration/query/one_to_one/simple_test.go +++ b/tests/integration/query/one_to_one/simple_test.go @@ -48,11 +48,11 @@ func TestQueryOneToOne(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", "age": uint64(65), }, @@ -89,11 +89,11 @@ func TestQueryOneToOne(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "published": map[string]interface{}{ + "published": map[string]any{ "name": "Painted House", "rating": 4.9, }, diff --git a/tests/integration/query/one_to_one/with_filter_test.go b/tests/integration/query/one_to_one/with_filter_test.go index 8d031b0fa1..96dddc1684 100644 --- a/tests/integration/query/one_to_one/with_filter_test.go +++ b/tests/integration/query/one_to_one/with_filter_test.go @@ -47,11 +47,11 @@ func TestQueryOneToOneWithNumericFilterOnParent(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", "age": uint64(65), }, @@ -93,11 +93,11 @@ func TestQueryOneToOneWithStringFilterOnChild(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", "age": uint64(65), }, @@ -139,11 +139,11 @@ func TestQueryOneToOneWithBooleanFilterOnChild(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", "age": uint64(65), }, @@ -197,11 +197,11 @@ func TestQueryOneToOneWithFilterThroughChildBackToParent(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", "age": uint64(65), }, diff --git a/tests/integration/query/one_to_one/with_order_test.go b/tests/integration/query/one_to_one/with_order_test.go index 0afd8aa3a7..5d60417f9e 100644 --- a/tests/integration/query/one_to_one/with_order_test.go +++ b/tests/integration/query/one_to_one/with_order_test.go @@ -61,11 +61,11 @@ func TestQueryOneToOneWithChildBooleanOrderDescending(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", "age": uint64(65), }, @@ -73,7 +73,7 @@ func TestQueryOneToOneWithChildBooleanOrderDescending(t *testing.T) { { "name": "Theif Lord", "rating": 4.8, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "Cornelia Funke", "age": uint64(62), }, diff --git a/tests/integration/query/one_to_two_many/simple_test.go b/tests/integration/query/one_to_two_many/simple_test.go index 64134f2aae..13cf9bcc4e 100644 --- a/tests/integration/query/one_to_two_many/simple_test.go +++ b/tests/integration/query/one_to_two_many/simple_test.go @@ -71,14 +71,14 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", }, - "reviewedBy": map[string]interface{}{ + "reviewedBy": map[string]any{ "name": "Cornelia Funke", "age": uint64(62), }, @@ -86,10 +86,10 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship(t *testing.T) { { "name": "Theif Lord", "rating": 4.8, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "Cornelia Funke", }, - "reviewedBy": map[string]interface{}{ + "reviewedBy": map[string]any{ "name": "John Grisham", "age": uint64(65), }, @@ -97,10 +97,10 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship(t *testing.T) { { "name": "A Time for Mercy", "rating": 4.5, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", }, - "reviewedBy": map[string]interface{}{ + "reviewedBy": map[string]any{ "name": "Cornelia Funke", "age": uint64(62), }, @@ -160,17 +160,17 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "reviewed": []map[string]interface{}{ + "reviewed": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, }, }, - "written": []map[string]interface{}{ + "written": []map[string]any{ { "name": "Painted House", }, @@ -182,7 +182,7 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship(t *testing.T) { { "name": "Cornelia Funke", "age": uint64(62), - "reviewed": []map[string]interface{}{ + "reviewed": []map[string]any{ { "name": "Painted House", "rating": 4.9, @@ -192,7 +192,7 @@ func TestQueryOneToTwoManyWithNilUnnamedRelationship(t *testing.T) { "rating": 4.5, }, }, - "written": []map[string]interface{}{ + "written": []map[string]any{ { "name": "Theif Lord", }, @@ -281,18 +281,18 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "Theif Lord", "rating": 4.8, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "Cornelia Funke", }, - "reviewedBy": map[string]interface{}{ + "reviewedBy": map[string]any{ "name": "John Grisham", "age": uint64(65), }, - "price": map[string]interface{}{ + "price": map[string]any{ "currency": "GBP", "value": 12.99, }, @@ -300,14 +300,14 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships(t *testing.T) { { "name": "A Time for Mercy", "rating": 4.5, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", }, - "reviewedBy": map[string]interface{}{ + "reviewedBy": map[string]any{ "name": "Cornelia Funke", "age": uint64(62), }, - "price": map[string]interface{}{ + "price": map[string]any{ "currency": "SEK", "value": float64(129), }, @@ -315,14 +315,14 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships(t *testing.T) { { "name": "Painted House", "rating": 4.9, - "author": map[string]interface{}{ + "author": map[string]any{ "name": "John Grisham", }, - "reviewedBy": map[string]interface{}{ + "reviewedBy": map[string]any{ "name": "Cornelia Funke", "age": uint64(62), }, - "price": map[string]interface{}{ + "price": map[string]any{ "currency": "GBP", "value": 12.99, }, @@ -400,26 +400,26 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", "age": uint64(65), - "reviewed": []map[string]interface{}{ + "reviewed": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, }, }, - "written": []map[string]interface{}{ + "written": []map[string]any{ { "name": "A Time for Mercy", - "price": map[string]interface{}{ + "price": map[string]any{ "value": float64(129), }, }, { "name": "Painted House", - "price": map[string]interface{}{ + "price": map[string]any{ "value": 12.99, }, }, @@ -428,7 +428,7 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships(t *testing.T) { { "name": "Cornelia Funke", "age": uint64(62), - "reviewed": []map[string]interface{}{ + "reviewed": []map[string]any{ { "name": "A Time for Mercy", "rating": 4.5, @@ -438,10 +438,10 @@ func TestQueryOneToTwoManyWithNamedAndUnnamedRelationships(t *testing.T) { "rating": 4.9, }, }, - "written": []map[string]interface{}{ + "written": []map[string]any{ { "name": "Theif Lord", - "price": map[string]interface{}{ + "price": map[string]any{ "value": 12.99, }, }, diff --git a/tests/integration/query/one_to_two_many/with_order_test.go b/tests/integration/query/one_to_two_many/with_order_test.go index c0e8f5156a..a2bb55d056 100644 --- a/tests/integration/query/one_to_two_many/with_order_test.go +++ b/tests/integration/query/one_to_two_many/with_order_test.go @@ -70,10 +70,10 @@ func TestQueryOneToTwoManyWithOrder(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "name": "John Grisham", - "reviewed": []map[string]interface{}{ + "reviewed": []map[string]any{ { "name": "Theif Lord", "rating": 4.8, @@ -83,7 +83,7 @@ func TestQueryOneToTwoManyWithOrder(t *testing.T) { "rating": 4.5, }, }, - "written": []map[string]interface{}{ + "written": []map[string]any{ { "name": "A Time for Mercy", }, @@ -94,13 +94,13 @@ func TestQueryOneToTwoManyWithOrder(t *testing.T) { }, { "name": "Cornelia Funke", - "reviewed": []map[string]interface{}{ + "reviewed": []map[string]any{ { "name": "Painted House", "rating": 4.9, }, }, - "written": []map[string]interface{}{ + "written": []map[string]any{ { "name": "Theif Lord", }, diff --git a/tests/integration/query/simple/explain_with_filter_test.go b/tests/integration/query/simple/explain_with_filter_test.go index ba5dda1233..d5bfafadb3 100644 --- a/tests/integration/query/simple/explain_with_filter_test.go +++ b/tests/integration/query/simple/explain_with_filter_test.go @@ -830,7 +830,7 @@ func TestExplainQuerySimpleWithNumberGreaterThanAndNumberLessThanFilter(t *testi "collectionID": "1", "collectionName": "users", "filter": dataMap{ - "_and": []interface{}{ + "_and": []any{ dataMap{ "Age": dataMap{ "_gt": int64(20), @@ -899,7 +899,7 @@ func TestExplainQuerySimpleWithNumberEqualToXOrYFilter(t *testing.T) { "collectionID": "1", "collectionName": "users", "filter": dataMap{ - "_or": []interface{}{ + "_or": []any{ dataMap{ "Age": dataMap{ "_eq": int64(55), @@ -969,7 +969,7 @@ func TestExplainQuerySimpleWithNumberInFilter(t *testing.T) { "collectionName": "users", "filter": dataMap{ "Age": dataMap{ - "_in": []interface{}{ + "_in": []any{ int64(19), int64(40), int64(55), diff --git a/tests/integration/query/simple/simple_test.go b/tests/integration/query/simple/simple_test.go index e209eefa2a..3c31d728fd 100644 --- a/tests/integration/query/simple/simple_test.go +++ b/tests/integration/query/simple/simple_test.go @@ -34,7 +34,7 @@ func TestQuerySimple(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_key": "bae-52b9170d-b77a-5887-b877-cbdbb99b009f", "Name": "John", @@ -63,7 +63,7 @@ func TestQuerySimpleWithAlias(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "username": "John", "age": uint64(21), @@ -95,7 +95,7 @@ func TestQuerySimpleWithMultipleRows(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", "Age": uint64(27), @@ -144,7 +144,7 @@ func TestQuerySimpleWithSomeDefaultValues(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Email": nil, @@ -177,7 +177,7 @@ func TestQuerySimpleWithDefaultValue(t *testing.T) { `{ }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) diff --git a/tests/integration/query/simple/utils.go b/tests/integration/query/simple/utils.go index 5b508a1bb3..f6e3543929 100644 --- a/tests/integration/query/simple/utils.go +++ b/tests/integration/query/simple/utils.go @@ -16,7 +16,7 @@ import ( testUtils "github.com/sourcenetwork/defradb/tests/integration" ) -type dataMap = map[string]interface{} +type dataMap = map[string]any var userCollectionGQLSchema = (` type users { diff --git a/tests/integration/query/simple/with_average_filter_test.go b/tests/integration/query/simple/with_average_filter_test.go index a99e4e710c..ab1464602c 100644 --- a/tests/integration/query/simple/with_average_filter_test.go +++ b/tests/integration/query/simple/with_average_filter_test.go @@ -38,7 +38,7 @@ func TestQuerySimpleWithAverageWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_avg": float64(31), }, diff --git a/tests/integration/query/simple/with_average_test.go b/tests/integration/query/simple/with_average_test.go index 673d0304f6..a2c7fe1532 100644 --- a/tests/integration/query/simple/with_average_test.go +++ b/tests/integration/query/simple/with_average_test.go @@ -46,7 +46,7 @@ func TestQuerySimpleWithAverageOnEmptyCollection(t *testing.T) { Query: `query { _avg(users: {field: Age}) }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_avg": float64(0), }, @@ -74,7 +74,7 @@ func TestQuerySimpleWithAverage(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_avg": float64(29), }, diff --git a/tests/integration/query/simple/with_cid_dockey_test.go b/tests/integration/query/simple/with_cid_dockey_test.go index ae8626100b..395e78808a 100644 --- a/tests/integration/query/simple/with_cid_dockey_test.go +++ b/tests/integration/query/simple/with_cid_dockey_test.go @@ -87,7 +87,7 @@ func TestQuerySimpleWithCidAndDocKey(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -127,7 +127,7 @@ func TestQuerySimpleWithUpdateAndFirstCidAndDocKey(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -168,7 +168,7 @@ func TestQuerySimpleWithUpdateAndLastCidAndDocKey(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(23), @@ -209,7 +209,7 @@ func TestQuerySimpleWithUpdateAndMiddleCidAndDocKey(t *testing.T) { }, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(22), diff --git a/tests/integration/query/simple/with_count_filter_test.go b/tests/integration/query/simple/with_count_filter_test.go index fee530d216..1624510a56 100644 --- a/tests/integration/query/simple/with_count_filter_test.go +++ b/tests/integration/query/simple/with_count_filter_test.go @@ -38,7 +38,7 @@ func TestQuerySimpleWithCountWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_count": 2, }, diff --git a/tests/integration/query/simple/with_count_test.go b/tests/integration/query/simple/with_count_test.go index 4b0ef066a0..d466941b64 100644 --- a/tests/integration/query/simple/with_count_test.go +++ b/tests/integration/query/simple/with_count_test.go @@ -34,7 +34,7 @@ func TestQuerySimpleWithCountOnEmptyCollection(t *testing.T) { Query: `query { _count(users: {}) }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_count": 0, }, @@ -62,7 +62,7 @@ func TestQuerySimpleWithCount(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_count": 2, }, diff --git a/tests/integration/query/simple/with_dockey_test.go b/tests/integration/query/simple/with_dockey_test.go index 29d76efdd7..6bf2100dbd 100644 --- a/tests/integration/query/simple/with_dockey_test.go +++ b/tests/integration/query/simple/with_dockey_test.go @@ -34,7 +34,7 @@ func TestQuerySimpleWithDocKeyFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -57,7 +57,7 @@ func TestQuerySimpleWithDocKeyFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, { Description: "Simple query with basic filter (key by DocKey arg), partial results", @@ -79,7 +79,7 @@ func TestQuerySimpleWithDocKeyFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), diff --git a/tests/integration/query/simple/with_dockeys_test.go b/tests/integration/query/simple/with_dockeys_test.go index ce44cde881..9761be2037 100644 --- a/tests/integration/query/simple/with_dockeys_test.go +++ b/tests/integration/query/simple/with_dockeys_test.go @@ -34,7 +34,7 @@ func TestQuerySimpleWithDocKeysFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -57,7 +57,7 @@ func TestQuerySimpleWithDocKeysFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, { Description: "Simple query with basic filter (duplicate key by DocKeys arg), partial results", @@ -79,7 +79,7 @@ func TestQuerySimpleWithDocKeysFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -110,7 +110,7 @@ func TestQuerySimpleWithDocKeysFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Jim", "Age": uint64(27), @@ -145,7 +145,7 @@ func TestQuerySimpleReturnsNothinGivenEmptyDocKeysFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) diff --git a/tests/integration/query/simple/with_filter/with_and_test.go b/tests/integration/query/simple/with_filter/with_and_test.go index 2b8a283d1d..008444a0de 100644 --- a/tests/integration/query/simple/with_filter/with_and_test.go +++ b/tests/integration/query/simple/with_filter/with_and_test.go @@ -45,7 +45,7 @@ func TestQuerySimpleWithIntGreaterThanAndIntLessThanFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", "Age": uint64(32), diff --git a/tests/integration/query/simple/with_filter/with_eq_float_test.go b/tests/integration/query/simple/with_filter/with_eq_float_test.go index 9c64d70286..44095d907b 100644 --- a/tests/integration/query/simple/with_filter/with_eq_float_test.go +++ b/tests/integration/query/simple/with_filter/with_eq_float_test.go @@ -37,7 +37,7 @@ func TestQuerySimpleWithFloatEqualsFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "HeightM": float64(2.1), @@ -72,7 +72,7 @@ func TestQuerySimpleWithFloatEqualsNilFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Fred", "HeightM": nil, diff --git a/tests/integration/query/simple/with_filter/with_eq_int_test.go b/tests/integration/query/simple/with_filter/with_eq_int_test.go index 67d4c6a95f..4a52154e18 100644 --- a/tests/integration/query/simple/with_filter/with_eq_int_test.go +++ b/tests/integration/query/simple/with_filter/with_eq_int_test.go @@ -37,7 +37,7 @@ func TestQuerySimpleWithIntEqualsFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -72,7 +72,7 @@ func TestQuerySimpleWithIntEqualsNilFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Fred", "Age": nil, diff --git a/tests/integration/query/simple/with_filter/with_eq_string_test.go b/tests/integration/query/simple/with_filter/with_eq_string_test.go index c201dd83f8..65e22fd4df 100644 --- a/tests/integration/query/simple/with_filter/with_eq_string_test.go +++ b/tests/integration/query/simple/with_filter/with_eq_string_test.go @@ -37,7 +37,7 @@ func TestQuerySimpleWithStringFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -72,7 +72,7 @@ func TestQuerySimpleWithStringEqualsNilFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": nil, "Age": uint64(60), @@ -104,7 +104,7 @@ func TestQuerySimpleWithStringFilterBlockAndSelect(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -129,7 +129,7 @@ func TestQuerySimpleWithStringFilterBlockAndSelect(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(21), }, @@ -151,7 +151,7 @@ func TestQuerySimpleWithStringFilterBlockAndSelect(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, } diff --git a/tests/integration/query/simple/with_filter/with_ge_float_test.go b/tests/integration/query/simple/with_filter/with_ge_float_test.go index 32171e5c6c..59be2ad65a 100644 --- a/tests/integration/query/simple/with_filter/with_ge_float_test.go +++ b/tests/integration/query/simple/with_filter/with_ge_float_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithHeightMGEFilterBlockWithEqualValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -66,7 +66,7 @@ func TestQuerySimpleWithHeightMGEFilterBlockWithLesserValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -96,7 +96,7 @@ func TestQuerySimpleWithHeightMGEFilterBlockWithLesserIntValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -125,7 +125,7 @@ func TestQuerySimpleWithHeightMGEFilterBlockWithNilValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, diff --git a/tests/integration/query/simple/with_filter/with_ge_int_test.go b/tests/integration/query/simple/with_filter/with_ge_int_test.go index 0b0b9b6f5a..0097600b4d 100644 --- a/tests/integration/query/simple/with_filter/with_ge_int_test.go +++ b/tests/integration/query/simple/with_filter/with_ge_int_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithIntGEFilterBlockWithEqualValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -66,7 +66,7 @@ func TestQuerySimpleWithIntGEFilterBlockWithGreaterValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -95,7 +95,7 @@ func TestQuerySimpleWithIntGEFilterBlockWithNilValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, diff --git a/tests/integration/query/simple/with_filter/with_gt_float_test.go b/tests/integration/query/simple/with_filter/with_gt_float_test.go index eabb5d94f0..d87bf85dd2 100644 --- a/tests/integration/query/simple/with_filter/with_gt_float_test.go +++ b/tests/integration/query/simple/with_filter/with_gt_float_test.go @@ -37,7 +37,7 @@ func TestQuerySimpleWithFloatGreaterThanFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -62,7 +62,7 @@ func TestQuerySimpleWithFloatGreaterThanFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, { Description: "Simple query with basic float greater than filter, multiple results", @@ -83,7 +83,7 @@ func TestQuerySimpleWithFloatGreaterThanFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -119,7 +119,7 @@ func TestQuerySimpleWithFloatGreaterThanFilterBlockWithIntFilterValue(t *testing }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -148,7 +148,7 @@ func TestQuerySimpleWithFloatGreaterThanFilterBlockWithNullFilterValue(t *testin }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, diff --git a/tests/integration/query/simple/with_filter/with_gt_int_test.go b/tests/integration/query/simple/with_filter/with_gt_int_test.go index a56c324a05..39db35f99e 100644 --- a/tests/integration/query/simple/with_filter/with_gt_int_test.go +++ b/tests/integration/query/simple/with_filter/with_gt_int_test.go @@ -38,7 +38,7 @@ func TestQuerySimpleWithIntGreaterThanFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -65,7 +65,7 @@ func TestQuerySimpleWithIntGreaterThanFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, }, { Description: "Simple query with basic filter(age), multiple results", @@ -87,7 +87,7 @@ func TestQuerySimpleWithIntGreaterThanFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", "Age": uint64(32), @@ -124,7 +124,7 @@ func TestQuerySimpleWithIntGreaterThanFilterBlockWithNullFilterValue(t *testing. }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, diff --git a/tests/integration/query/simple/with_filter/with_in_test.go b/tests/integration/query/simple/with_filter/with_in_test.go index 1817177170..63f0bb14f2 100644 --- a/tests/integration/query/simple/with_filter/with_in_test.go +++ b/tests/integration/query/simple/with_filter/with_in_test.go @@ -45,7 +45,7 @@ func TestQuerySimpleWithIntInFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "Age": uint64(19), @@ -92,7 +92,7 @@ func TestQuerySimpleWithIntInFilterWithNullValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Fred", "Age": nil, diff --git a/tests/integration/query/simple/with_filter/with_le_float_test.go b/tests/integration/query/simple/with_filter/with_le_float_test.go index c80f09ad48..ce7d06192c 100644 --- a/tests/integration/query/simple/with_filter/with_le_float_test.go +++ b/tests/integration/query/simple/with_filter/with_le_float_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithFloatLEFilterBlockWithEqualValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -66,7 +66,7 @@ func TestQuerySimpleWithFloatLEFilterBlockWithGreaterValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -96,7 +96,7 @@ func TestQuerySimpleWithFloatLEFilterBlockWithGreaterIntValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -125,7 +125,7 @@ func TestQuerySimpleWithFloatLEFilterBlockWithNullValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, diff --git a/tests/integration/query/simple/with_filter/with_le_int_test.go b/tests/integration/query/simple/with_filter/with_le_int_test.go index 3c2234b374..36420d029e 100644 --- a/tests/integration/query/simple/with_filter/with_le_int_test.go +++ b/tests/integration/query/simple/with_filter/with_le_int_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithIntLEFilterBlockWithEqualValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -66,7 +66,7 @@ func TestQuerySimpleWithIntLEFilterBlockWithGreaterValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -95,7 +95,7 @@ func TestQuerySimpleWithIntLEFilterBlockWithNullValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, diff --git a/tests/integration/query/simple/with_filter/with_lt_float_test.go b/tests/integration/query/simple/with_filter/with_lt_float_test.go index ba2322eabe..99850ba5a7 100644 --- a/tests/integration/query/simple/with_filter/with_lt_float_test.go +++ b/tests/integration/query/simple/with_filter/with_lt_float_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithFloatLessThanFilterBlockWithGreaterValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -66,7 +66,7 @@ func TestQuerySimpleWithFloatLessThanFilterBlockWithGreaterIntValue(t *testing.T }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -96,7 +96,7 @@ func TestQuerySimpleWithFloatLessThanFilterBlockWithNullValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) diff --git a/tests/integration/query/simple/with_filter/with_lt_int_test.go b/tests/integration/query/simple/with_filter/with_lt_int_test.go index e0e07cd6e6..7318647031 100644 --- a/tests/integration/query/simple/with_filter/with_lt_int_test.go +++ b/tests/integration/query/simple/with_filter/with_lt_int_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithIntLessThanFilterBlockWithGreaterValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -65,7 +65,7 @@ func TestQuerySimpleWithIntLessThanFilterBlockWithNullValue(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) diff --git a/tests/integration/query/simple/with_filter/with_ne_bool_test.go b/tests/integration/query/simple/with_filter/with_ne_bool_test.go index 48b722e489..ec4715e2f3 100644 --- a/tests/integration/query/simple/with_filter/with_ne_bool_test.go +++ b/tests/integration/query/simple/with_filter/with_ne_bool_test.go @@ -39,7 +39,7 @@ func TestQuerySimpleWithBoolNotEqualsTrueFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Fred", }, @@ -75,7 +75,7 @@ func TestQuerySimpleWithBoolNotEqualsNilFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Fred", }, @@ -111,7 +111,7 @@ func TestQuerySimpleWithBoolNotEqualsFalseFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, diff --git a/tests/integration/query/simple/with_filter/with_ne_float_test.go b/tests/integration/query/simple/with_filter/with_ne_float_test.go index 5f4c81d6e5..133e1799b8 100644 --- a/tests/integration/query/simple/with_filter/with_ne_float_test.go +++ b/tests/integration/query/simple/with_filter/with_ne_float_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithFloatNotEqualsFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -69,7 +69,7 @@ func TestQuerySimpleWithFloatNotEqualsNilFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, diff --git a/tests/integration/query/simple/with_filter/with_ne_int_test.go b/tests/integration/query/simple/with_filter/with_ne_int_test.go index eae428a713..4f7c240205 100644 --- a/tests/integration/query/simple/with_filter/with_ne_int_test.go +++ b/tests/integration/query/simple/with_filter/with_ne_int_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithIntNotEqualsFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, @@ -69,7 +69,7 @@ func TestQuerySimpleWithIntNotEqualsNilFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, diff --git a/tests/integration/query/simple/with_filter/with_ne_string_test.go b/tests/integration/query/simple/with_filter/with_ne_string_test.go index e1b31df6aa..23ca1931a3 100644 --- a/tests/integration/query/simple/with_filter/with_ne_string_test.go +++ b/tests/integration/query/simple/with_filter/with_ne_string_test.go @@ -36,7 +36,7 @@ func TestQuerySimpleWithStringNotEqualsFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), }, @@ -69,7 +69,7 @@ func TestQuerySimpleWithStringNotEqualsNilFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), }, diff --git a/tests/integration/query/simple/with_filter/with_nin_test.go b/tests/integration/query/simple/with_filter/with_nin_test.go index 8137c5d66c..ac0bb4c469 100644 --- a/tests/integration/query/simple/with_filter/with_nin_test.go +++ b/tests/integration/query/simple/with_filter/with_nin_test.go @@ -47,7 +47,7 @@ func TestQuerySimpleWithNotInFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", }, diff --git a/tests/integration/query/simple/with_filter/with_or_test.go b/tests/integration/query/simple/with_filter/with_or_test.go index 3093af02d0..97371374dc 100644 --- a/tests/integration/query/simple/with_filter/with_or_test.go +++ b/tests/integration/query/simple/with_filter/with_or_test.go @@ -45,7 +45,7 @@ func TestQuerySimpleWithIntEqualToXOrYFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "Age": uint64(19), diff --git a/tests/integration/query/simple/with_group_average_count_test.go b/tests/integration/query/simple/with_group_average_count_test.go index e6834f8913..7034108042 100644 --- a/tests/integration/query/simple/with_group_average_count_test.go +++ b/tests/integration/query/simple/with_group_average_count_test.go @@ -47,7 +47,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerAverageA }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(35), diff --git a/tests/integration/query/simple/with_group_average_filter_test.go b/tests/integration/query/simple/with_group_average_filter_test.go index b154f5c9d1..12c4ca122b 100644 --- a/tests/integration/query/simple/with_group_average_filter_test.go +++ b/tests/integration/query/simple/with_group_average_filter_test.go @@ -41,7 +41,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildAverageWithFilt }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "_avg": float64(0), @@ -84,11 +84,11 @@ func TestQuerySimpleWithGroupByStringWithRenderedGroupAndChildAverageWithFilter( }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "_avg": float64(0), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -97,7 +97,7 @@ func TestQuerySimpleWithGroupByStringWithRenderedGroupAndChildAverageWithFilter( { "Name": "John", "_avg": float64(33), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), }, @@ -140,16 +140,16 @@ func TestQuerySimpleWithGroupByStringWithRenderedGroupWithFilterAndChildAverageW }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "_avg": float64(0), - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, { "Name": "John", "_avg": float64(34), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(34), }, @@ -189,11 +189,11 @@ func TestQuerySimpleWithGroupByStringWithRenderedGroupWithFilterAndChildAverageW }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "_avg": float64(0), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -202,7 +202,7 @@ func TestQuerySimpleWithGroupByStringWithRenderedGroupWithFilterAndChildAverageW { "Name": "John", "_avg": float64(34), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), }, @@ -240,7 +240,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildAveragesWithDif }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "A1": float64(0), @@ -290,7 +290,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildAverageWithFilt }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "_avg": float64(19), diff --git a/tests/integration/query/simple/with_group_average_limit_offset_test.go b/tests/integration/query/simple/with_group_average_limit_offset_test.go index 9a845876ee..e60bb42a11 100644 --- a/tests/integration/query/simple/with_group_average_limit_offset_test.go +++ b/tests/integration/query/simple/with_group_average_limit_offset_test.go @@ -46,7 +46,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerAverageW }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(35), diff --git a/tests/integration/query/simple/with_group_average_limit_test.go b/tests/integration/query/simple/with_group_average_limit_test.go index 5a0f8c9771..2c6eed4576 100644 --- a/tests/integration/query/simple/with_group_average_limit_test.go +++ b/tests/integration/query/simple/with_group_average_limit_test.go @@ -46,7 +46,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerAverageW }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(33), diff --git a/tests/integration/query/simple/with_group_average_sum_test.go b/tests/integration/query/simple/with_group_average_sum_test.go index 0a64b2a5b3..97a746c094 100644 --- a/tests/integration/query/simple/with_group_average_sum_test.go +++ b/tests/integration/query/simple/with_group_average_sum_test.go @@ -58,11 +58,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfCountOfInt(t * }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": float64(62.5), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_avg": float64(28.5), @@ -76,7 +76,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfCountOfInt(t * { "Name": "Alice", "_sum": float64(19), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_avg": float64(19), @@ -86,7 +86,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfCountOfInt(t * { "Name": "Carlo", "_sum": float64(55), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_avg": float64(55), @@ -130,7 +130,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerAverageA }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(35), diff --git a/tests/integration/query/simple/with_group_average_test.go b/tests/integration/query/simple/with_group_average_test.go index f67d76daf5..697bd5d7e3 100644 --- a/tests/integration/query/simple/with_group_average_test.go +++ b/tests/integration/query/simple/with_group_average_test.go @@ -48,7 +48,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerAverageO _avg(_group: {field: Age}) } }`, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) @@ -80,7 +80,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerAverage( }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(35), @@ -120,7 +120,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildNilAverage(t *t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "_avg": float64(19), @@ -177,11 +177,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfI }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(31.25), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_avg": float64(28.5), @@ -195,7 +195,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfI { "Name": "Alice", "_avg": float64(19), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_avg": float64(19), @@ -205,7 +205,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfI { "Name": "Carlo", "_avg": float64(55), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_avg": float64(55), @@ -242,7 +242,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildEmptyFloatAvera }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(1.855), @@ -282,7 +282,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildFloatAverage(t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(1.855), @@ -339,11 +339,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfF }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(1.9675000000000002), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_avg": float64(2.22), @@ -357,7 +357,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfF { "Name": "Alice", "_avg": float64(2.04), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_avg": float64(2.04), @@ -367,7 +367,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfF { "Name": "Carlo", "_avg": float64(1.74), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_avg": float64(1.74), @@ -431,15 +431,15 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfA }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_avg": float64(1.9675000000000002), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_avg": float64(2.22), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(34), "_avg": float64(2.22), @@ -449,7 +449,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfA { "Verified": true, "_avg": float64(1.715), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), "_avg": float64(1.61), @@ -465,11 +465,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfA { "Name": "Alice", "_avg": float64(2.04), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_avg": float64(2.04), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), "_avg": float64(2.04), @@ -481,11 +481,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndAverageOfAverageOfA { "Name": "Carlo", "_avg": float64(1.74), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_avg": float64(1.74), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), "_avg": float64(1.74), diff --git a/tests/integration/query/simple/with_group_count_filter_test.go b/tests/integration/query/simple/with_group_count_filter_test.go index 63cd3d3d6f..86ce93ba80 100644 --- a/tests/integration/query/simple/with_group_count_filter_test.go +++ b/tests/integration/query/simple/with_group_count_filter_test.go @@ -41,7 +41,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndChildCountWithFilter }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 2, @@ -84,11 +84,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupAndChildCountWithFilter(t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 2, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -100,7 +100,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupAndChildCountWithFilter(t { "Age": uint64(19), "_count": 0, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Alice", }, @@ -140,11 +140,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithFilterAndChildCountWit }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 1, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "John", }, @@ -153,7 +153,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithFilterAndChildCountWit { "Age": uint64(19), "_count": 0, - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, } @@ -189,11 +189,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithFilterAndChildCountWit }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 2, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "John", }, @@ -202,7 +202,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithFilterAndChildCountWit { "Age": uint64(19), "_count": 0, - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, } @@ -236,7 +236,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndChildCountsWithDiffe }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "C1": 2, diff --git a/tests/integration/query/simple/with_group_count_limit_offset_test.go b/tests/integration/query/simple/with_group_count_limit_offset_test.go index a19ad70cfd..7c15fa6c0c 100644 --- a/tests/integration/query/simple/with_group_count_limit_offset_test.go +++ b/tests/integration/query/simple/with_group_count_limit_offset_test.go @@ -41,7 +41,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndChildCountWithLimitA }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 1, @@ -88,11 +88,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithLimitAndChildCountWith }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 1, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -104,7 +104,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithLimitAndChildCountWith { "Age": uint64(19), "_count": 0, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Alice", }, diff --git a/tests/integration/query/simple/with_group_count_limit_test.go b/tests/integration/query/simple/with_group_count_limit_test.go index fdcbe013f8..ca8df06ca9 100644 --- a/tests/integration/query/simple/with_group_count_limit_test.go +++ b/tests/integration/query/simple/with_group_count_limit_test.go @@ -41,7 +41,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndChildCountWithLimit( }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 1, @@ -88,11 +88,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithLimitAndChildCountWith }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 1, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -104,7 +104,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithLimitAndChildCountWith { "Age": uint64(19), "_count": 1, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Alice", }, diff --git a/tests/integration/query/simple/with_group_count_sum_test.go b/tests/integration/query/simple/with_group_count_sum_test.go index 671db66bfe..672dc1e250 100644 --- a/tests/integration/query/simple/with_group_count_sum_test.go +++ b/tests/integration/query/simple/with_group_count_sum_test.go @@ -58,11 +58,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfCount(t *testi }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": int64(3), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_count": int(2), @@ -76,7 +76,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfCount(t *testi { "Name": "Alice", "_sum": int64(1), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_count": int(1), @@ -86,7 +86,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfCount(t *testi { "Name": "Carlo", "_sum": int64(1), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_count": int(1), diff --git a/tests/integration/query/simple/with_group_count_test.go b/tests/integration/query/simple/with_group_count_test.go index 4c1c18ccbd..cacfbeb6e9 100644 --- a/tests/integration/query/simple/with_group_count_test.go +++ b/tests/integration/query/simple/with_group_count_test.go @@ -90,7 +90,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndChildCount(t *testin }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 2, @@ -114,7 +114,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndChildCountOnEmptyCol _count(_group: {}) } }`, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) @@ -148,11 +148,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupAndChildCount(t *testing.T }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_count": 2, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -164,7 +164,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupAndChildCount(t *testing.T { "Age": uint64(19), "_count": 1, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Alice", }, @@ -232,7 +232,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndAliasesChildCount(t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "Count": 2, @@ -275,7 +275,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndDuplicatedAliasedChi }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "Count1": 2, diff --git a/tests/integration/query/simple/with_group_filter_test.go b/tests/integration/query/simple/with_group_filter_test.go index 88cc89937e..4eea221d5c 100644 --- a/tests/integration/query/simple/with_group_filter_test.go +++ b/tests/integration/query/simple/with_group_filter_test.go @@ -47,14 +47,14 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), }, @@ -62,7 +62,7 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberFilter(t *testing.T) { }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -105,10 +105,10 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberWithParentFilter(t *testing. }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), }, @@ -116,7 +116,7 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberWithParentFilter(t *testing. }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -156,7 +156,7 @@ func TestQuerySimpleWithGroupByStringWithUnrenderedGroupNumberWithParentFilter(t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", }, @@ -214,35 +214,35 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanThenInnerNumberFilterT }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, { "Verified": false, - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, }, { "Name": "Alice", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, }, @@ -286,11 +286,11 @@ func TestQuerySimpleWithGroupByStringWithMultipleGroupNumberFilter(t *testing.T) }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", - "G1": []map[string]interface{}{}, - "G2": []map[string]interface{}{ + "G1": []map[string]any{}, + "G2": []map[string]any{ { "Age": uint64(19), }, @@ -298,12 +298,12 @@ func TestQuerySimpleWithGroupByStringWithMultipleGroupNumberFilter(t *testing.T) }, { "Name": "John", - "G1": []map[string]interface{}{ + "G1": []map[string]any{ { "Age": uint64(32), }, }, - "G2": []map[string]interface{}{ + "G2": []map[string]any{ { "Age": uint64(25), }, @@ -311,12 +311,12 @@ func TestQuerySimpleWithGroupByStringWithMultipleGroupNumberFilter(t *testing.T) }, { "Name": "Carlo", - "G1": []map[string]interface{}{ + "G1": []map[string]any{ { "Age": uint64(55), }, }, - "G2": []map[string]interface{}{}, + "G2": []map[string]any{}, }, }, } diff --git a/tests/integration/query/simple/with_group_limit_offset_test.go b/tests/integration/query/simple/with_group_limit_offset_test.go index c0cbac3463..ba707a68b9 100644 --- a/tests/integration/query/simple/with_group_limit_offset_test.go +++ b/tests/integration/query/simple/with_group_limit_offset_test.go @@ -43,10 +43,10 @@ func TestQuerySimpleWithGroupByNumberWithGroupLimitAndOffset(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "John", }, @@ -54,7 +54,7 @@ func TestQuerySimpleWithGroupByNumberWithGroupLimitAndOffset(t *testing.T) { }, { "Age": uint64(19), - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, } @@ -89,10 +89,10 @@ func TestQuerySimpleWithGroupByNumberWithLimitAndOffsetAndWithGroupLimitAndOffse }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(19), - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, } diff --git a/tests/integration/query/simple/with_group_limit_test.go b/tests/integration/query/simple/with_group_limit_test.go index 7644ec9071..5a28ad724f 100644 --- a/tests/integration/query/simple/with_group_limit_test.go +++ b/tests/integration/query/simple/with_group_limit_test.go @@ -43,10 +43,10 @@ func TestQuerySimpleWithGroupByNumberWithGroupLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -54,7 +54,7 @@ func TestQuerySimpleWithGroupByNumberWithGroupLimit(t *testing.T) { }, { "Age": uint64(19), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Alice", }, @@ -96,15 +96,15 @@ func TestQuerySimpleWithGroupByNumberWithMultipleGroupsWithDifferentLimits(t *te }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), - "G1": []map[string]interface{}{ + "G1": []map[string]any{ { "Name": "Bob", }, }, - "G2": []map[string]interface{}{ + "G2": []map[string]any{ { "Name": "Bob", }, @@ -115,12 +115,12 @@ func TestQuerySimpleWithGroupByNumberWithMultipleGroupsWithDifferentLimits(t *te }, { "Age": uint64(19), - "G1": []map[string]interface{}{ + "G1": []map[string]any{ { "Name": "Alice", }, }, - "G2": []map[string]interface{}{ + "G2": []map[string]any{ { "Name": "Alice", }, @@ -159,10 +159,10 @@ func TestQuerySimpleWithGroupByNumberWithLimitAndGroupWithHigherLimit(t *testing }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -208,10 +208,10 @@ func TestQuerySimpleWithGroupByNumberWithLimitAndGroupWithLowerLimit(t *testing. }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -219,7 +219,7 @@ func TestQuerySimpleWithGroupByNumberWithLimitAndGroupWithLowerLimit(t *testing. }, { "Age": uint64(42), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Alice", }, diff --git a/tests/integration/query/simple/with_group_order_test.go b/tests/integration/query/simple/with_group_order_test.go index e05588ad3a..2f2d6573c1 100644 --- a/tests/integration/query/simple/with_group_order_test.go +++ b/tests/integration/query/simple/with_group_order_test.go @@ -47,10 +47,10 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberWithGroupOrder(t *testing.T) }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -58,7 +58,7 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberWithGroupOrder(t *testing.T) }, { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(25), }, @@ -69,7 +69,7 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberWithGroupOrder(t *testing.T) }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -112,10 +112,10 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberWithGroupOrderDescending(t * }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -123,7 +123,7 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberWithGroupOrderDescending(t * }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -131,7 +131,7 @@ func TestQuerySimpleWithGroupByStringWithGroupNumberWithGroupOrderDescending(t * }, { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), }, @@ -177,10 +177,10 @@ func TestQuerySimpleWithGroupByStringAndOrderDescendingWithGroupNumberWithGroupO }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(25), }, @@ -191,7 +191,7 @@ func TestQuerySimpleWithGroupByStringAndOrderDescendingWithGroupNumberWithGroupO }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -199,7 +199,7 @@ func TestQuerySimpleWithGroupByStringAndOrderDescendingWithGroupNumberWithGroupO }, { "Name": "Alice", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -254,13 +254,13 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanThenInnerOrderDescendi }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), }, @@ -271,7 +271,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanThenInnerOrderDescendi }, { "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(34), }, @@ -281,10 +281,10 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanThenInnerOrderDescendi }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -294,10 +294,10 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanThenInnerOrderDescendi }, { "Name": "Alice", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -356,13 +356,13 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndOrderAscendingThenI }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(34), }, @@ -373,7 +373,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndOrderAscendingThenI }, { "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), }, @@ -383,10 +383,10 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndOrderAscendingThenI }, { "Name": "Alice", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -396,10 +396,10 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndOrderAscendingThenI }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, diff --git a/tests/integration/query/simple/with_group_sum_filter_test.go b/tests/integration/query/simple/with_group_sum_filter_test.go index 207afa110e..8dc8732a6a 100644 --- a/tests/integration/query/simple/with_group_sum_filter_test.go +++ b/tests/integration/query/simple/with_group_sum_filter_test.go @@ -41,7 +41,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndChildSumWithFilter(t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_sum": int64(64), @@ -84,11 +84,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupAndChildSumWithFilter(t *t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_sum": int64(64), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -100,7 +100,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupAndChildSumWithFilter(t *t { "Age": uint64(19), "_sum": int64(0), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Alice", }, @@ -140,11 +140,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithFilterAndChildSumWithM }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_sum": int64(32), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "John", }, @@ -153,7 +153,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithFilterAndChildSumWithM { "Age": uint64(19), "_sum": int64(0), - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, } @@ -189,11 +189,11 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithFilterAndChildSumWithD }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "_sum": int64(64), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "John", }, @@ -202,7 +202,7 @@ func TestQuerySimpleWithGroupByNumberWithRenderedGroupWithFilterAndChildSumWithD { "Age": uint64(19), "_sum": int64(0), - "_group": []map[string]interface{}{}, + "_group": []map[string]any{}, }, }, } @@ -236,7 +236,7 @@ func TestQuerySimpleWithGroupByNumberWithoutRenderedGroupAndChildSumsWithDiffere }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), "S1": int64(64), diff --git a/tests/integration/query/simple/with_group_sum_limit_offset_test.go b/tests/integration/query/simple/with_group_sum_limit_offset_test.go index aecc2506dc..27d49a77e0 100644 --- a/tests/integration/query/simple/with_group_sum_limit_offset_test.go +++ b/tests/integration/query/simple/with_group_sum_limit_offset_test.go @@ -46,7 +46,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerSumWithL }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": int64(70), diff --git a/tests/integration/query/simple/with_group_sum_limit_test.go b/tests/integration/query/simple/with_group_sum_limit_test.go index 2637673dee..8c66b3e9e3 100644 --- a/tests/integration/query/simple/with_group_sum_limit_test.go +++ b/tests/integration/query/simple/with_group_sum_limit_test.go @@ -46,7 +46,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerSumWithL }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": int64(66), diff --git a/tests/integration/query/simple/with_group_sum_test.go b/tests/integration/query/simple/with_group_sum_test.go index 11ed3796c1..2608dec26e 100644 --- a/tests/integration/query/simple/with_group_sum_test.go +++ b/tests/integration/query/simple/with_group_sum_test.go @@ -48,7 +48,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerSumOnEmp _sum(_group: {field: Age}) } }`, - Results: []map[string]interface{}{}, + Results: []map[string]any{}, } executeTestCase(t, test) @@ -80,7 +80,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildIntegerSum(t *t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": int64(70), @@ -120,7 +120,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildNilSum(t *testi }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "_sum": int64(19), @@ -177,11 +177,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfInt(t *te }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": int64(91), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_sum": int64(57), @@ -195,7 +195,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfInt(t *te { "Name": "Alice", "_sum": int64(19), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_sum": int64(19), @@ -205,7 +205,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfInt(t *te { "Name": "Carlo", "_sum": int64(55), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_sum": int64(55), @@ -242,7 +242,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildEmptyFloatSum(t }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": float64(3.71), @@ -282,7 +282,7 @@ func TestQuerySimpleWithGroupByStringWithoutRenderedGroupAndChildFloatSum(t *tes }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": float64(3.71), @@ -339,11 +339,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfFloat(t * }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": float64(5.65), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_sum": float64(2.22), @@ -357,7 +357,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfFloat(t * { "Name": "Alice", "_sum": float64(2.04), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_sum": float64(2.04), @@ -367,7 +367,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfFloat(t * { "Name": "Carlo", "_sum": float64(1.74), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_sum": float64(1.74), @@ -431,15 +431,15 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfSumOfFloa }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "_sum": float64(5.65), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_sum": float64(2.22), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(34), "_sum": float64(2.22), @@ -449,7 +449,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfSumOfFloa { "Verified": true, "_sum": float64(3.43), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), "_sum": float64(1.61), @@ -465,11 +465,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfSumOfFloa { "Name": "Alice", "_sum": float64(2.04), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, "_sum": float64(2.04), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), "_sum": float64(2.04), @@ -481,11 +481,11 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBooleanAndSumOfSumOfSumOfFloa { "Name": "Carlo", "_sum": float64(1.74), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, "_sum": float64(1.74), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), "_sum": float64(1.74), diff --git a/tests/integration/query/simple/with_group_test.go b/tests/integration/query/simple/with_group_test.go index e2f66a0783..9e61fc0c3e 100644 --- a/tests/integration/query/simple/with_group_test.go +++ b/tests/integration/query/simple/with_group_test.go @@ -44,7 +44,7 @@ func TestQuerySimpleWithGroupByNumber(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), }, @@ -91,10 +91,10 @@ func TestQuerySimpleWithGroupByNumberWithGroupString(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": uint64(32), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -105,7 +105,7 @@ func TestQuerySimpleWithGroupByNumberWithGroupString(t *testing.T) { }, { "Age": uint64(19), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Alice", }, @@ -113,7 +113,7 @@ func TestQuerySimpleWithGroupByNumberWithGroupString(t *testing.T) { }, { "Age": uint64(55), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Carlo", }, @@ -156,10 +156,10 @@ func TestQuerySimpleWithGroupByString(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -167,7 +167,7 @@ func TestQuerySimpleWithGroupByString(t *testing.T) { }, { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(32), }, @@ -178,7 +178,7 @@ func TestQuerySimpleWithGroupByString(t *testing.T) { }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -233,13 +233,13 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBoolean(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(25), }, @@ -250,7 +250,7 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBoolean(t *testing.T) { }, { "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(34), }, @@ -260,10 +260,10 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBoolean(t *testing.T) { }, { "Name": "Alice", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -273,10 +273,10 @@ func TestQuerySimpleWithGroupByStringWithInnerGroupBoolean(t *testing.T) { }, { "Name": "Carlo", - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -331,11 +331,11 @@ func TestQuerySimpleWithGroupByStringThenBoolean(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(25), }, @@ -347,7 +347,7 @@ func TestQuerySimpleWithGroupByStringThenBoolean(t *testing.T) { { "Name": "John", "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(34), }, @@ -356,7 +356,7 @@ func TestQuerySimpleWithGroupByStringThenBoolean(t *testing.T) { { "Name": "Alice", "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -365,7 +365,7 @@ func TestQuerySimpleWithGroupByStringThenBoolean(t *testing.T) { { "Name": "Carlo", "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -418,11 +418,11 @@ func TestQuerySimpleWithGroupByBooleanThenNumber(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(25), }, @@ -434,7 +434,7 @@ func TestQuerySimpleWithGroupByBooleanThenNumber(t *testing.T) { { "Name": "John", "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(34), }, @@ -443,7 +443,7 @@ func TestQuerySimpleWithGroupByBooleanThenNumber(t *testing.T) { { "Name": "Alice", "Verified": false, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(19), }, @@ -452,7 +452,7 @@ func TestQuerySimpleWithGroupByBooleanThenNumber(t *testing.T) { { "Name": "Carlo", "Verified": true, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Age": uint64(55), }, @@ -486,7 +486,7 @@ func TestQuerySimpleWithGroupByNumberOnUndefined(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": nil, }, @@ -524,10 +524,10 @@ func TestQuerySimpleWithGroupByNumberOnUndefinedWithChildren(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Age": nil, - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "Bob", }, @@ -538,7 +538,7 @@ func TestQuerySimpleWithGroupByNumberOnUndefinedWithChildren(t *testing.T) { }, { "Age": uint64(32), - "_group": []map[string]interface{}{ + "_group": []map[string]any{ { "Name": "John", }, diff --git a/tests/integration/query/simple/with_key_test.go b/tests/integration/query/simple/with_key_test.go index 0b8b04721f..0422fb233f 100644 --- a/tests/integration/query/simple/with_key_test.go +++ b/tests/integration/query/simple/with_key_test.go @@ -37,7 +37,7 @@ func TestQuerySimpleWithKeyFilterBlock(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), diff --git a/tests/integration/query/simple/with_limit_offset_test.go b/tests/integration/query/simple/with_limit_offset_test.go index 0e807facba..a0454cf288 100644 --- a/tests/integration/query/simple/with_limit_offset_test.go +++ b/tests/integration/query/simple/with_limit_offset_test.go @@ -38,7 +38,7 @@ func TestQuerySimpleWithLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", "Age": uint64(32), @@ -73,7 +73,7 @@ func TestQuerySimpleWithLimit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Bob", "Age": uint64(32), @@ -113,7 +113,7 @@ func TestQuerySimpleWithLimitAndOffset(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -148,7 +148,7 @@ func TestQuerySimpleWithLimitAndOffset(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -188,7 +188,7 @@ func TestQuerySimpleWithOffset(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), @@ -227,7 +227,7 @@ func TestQuerySimpleWithOffset(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "Age": uint64(19), diff --git a/tests/integration/query/simple/with_order_filter_test.go b/tests/integration/query/simple/with_order_filter_test.go index 3e104dd1ea..67e0a1a8b5 100644 --- a/tests/integration/query/simple/with_order_filter_test.go +++ b/tests/integration/query/simple/with_order_filter_test.go @@ -45,7 +45,7 @@ func TestQuerySimpleWithNumericGreaterThanFilterAndNumericOrderDescending(t *tes }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Carlo", "Age": uint64(55), diff --git a/tests/integration/query/simple/with_order_test.go b/tests/integration/query/simple/with_order_test.go index 09ccc4b8f2..18a001d951 100644 --- a/tests/integration/query/simple/with_order_test.go +++ b/tests/integration/query/simple/with_order_test.go @@ -45,7 +45,7 @@ func TestQuerySimpleWithNumericOrderAscending(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Alice", "Age": uint64(19), @@ -97,7 +97,7 @@ func TestQuerySimpleWithNumericOrderDescending(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Carlo", "Age": uint64(55), @@ -154,7 +154,7 @@ func TestQuerySimpleWithNumericOrderDescendingAndBooleanOrderAscending(t *testin }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "Carlo", "Age": uint64(55), diff --git a/tests/integration/query/simple/with_sum_filter_test.go b/tests/integration/query/simple/with_sum_filter_test.go index 6c595cfd70..ba91ae0634 100644 --- a/tests/integration/query/simple/with_sum_filter_test.go +++ b/tests/integration/query/simple/with_sum_filter_test.go @@ -38,7 +38,7 @@ func TestQuerySimpleWithSumWithFilter(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_sum": int64(62), }, diff --git a/tests/integration/query/simple/with_sum_test.go b/tests/integration/query/simple/with_sum_test.go index 60ab7a6356..6f5862d642 100644 --- a/tests/integration/query/simple/with_sum_test.go +++ b/tests/integration/query/simple/with_sum_test.go @@ -46,7 +46,7 @@ func TestQuerySimpleWithSumOnEmptyCollection(t *testing.T) { Query: `query { _sum(users: {field: Age}) }`, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_sum": int64(0), }, @@ -74,7 +74,7 @@ func TestQuerySimpleWithSum(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "_sum": int64(51), }, diff --git a/tests/integration/query/simple/with_version_test.go b/tests/integration/query/simple/with_version_test.go index d1a9c6b1bc..76df409029 100644 --- a/tests/integration/query/simple/with_version_test.go +++ b/tests/integration/query/simple/with_version_test.go @@ -40,14 +40,14 @@ func TestQuerySimpleWithEmbeddedLatestCommit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), - "_version": []map[string]interface{}{ + "_version": []map[string]any{ { "cid": "bafybeigriq4rcvsugsqiohxvtov2kvcmtqtldesobtx7vsjl556dhpliau", - "links": []map[string]interface{}{ + "links": []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", "name": "Age", @@ -93,14 +93,14 @@ func TestQuerySimpleWithMultipleAliasedEmbeddedLatestCommit(t *testing.T) { }`, }, }, - Results: []map[string]interface{}{ + Results: []map[string]any{ { "Name": "John", "Age": uint64(21), - "_version": []map[string]interface{}{ + "_version": []map[string]any{ { "cid": "bafybeigriq4rcvsugsqiohxvtov2kvcmtqtldesobtx7vsjl556dhpliau", - "L1": []map[string]interface{}{ + "L1": []map[string]any{ { "cid": "bafybeidst2mzxhdoh4ayjdjoh4vibo7vwnuoxk3xgyk5mzmep55jklni2a", "name": "Age", @@ -110,7 +110,7 @@ func TestQuerySimpleWithMultipleAliasedEmbeddedLatestCommit(t *testing.T) { "name": "Name", }, }, - "L2": []map[string]interface{}{ + "L2": []map[string]any{ { "name": "Age", }, diff --git a/tests/integration/schema/aggregates/inline_array_test.go b/tests/integration/schema/aggregates/inline_array_test.go index adc4afadcd..756014cac8 100644 --- a/tests/integration/schema/aggregates/inline_array_test.go +++ b/tests/integration/schema/aggregates/inline_array_test.go @@ -47,79 +47,79 @@ func TestSchemaAggregateInlineArrayCreatesUsersCount(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "FavouriteIntegers", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__FavouriteIntegers__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "NotNullIntFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "_group", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "_version", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users___version__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, @@ -167,33 +167,33 @@ func TestSchemaAggregateInlineArrayCreatesUsersSum(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_sum", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "FavouriteFloats", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__FavouriteFloats__NumericSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "NotNullFloatFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, @@ -206,32 +206,32 @@ func TestSchemaAggregateInlineArrayCreatesUsersSum(t *testing.T) { }, }, }, - map[string]interface{}{ + map[string]any{ "name": "_group", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__NumericSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "field", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, @@ -285,33 +285,33 @@ func TestSchemaAggregateInlineArrayCreatesUsersAverage(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_avg", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "FavouriteIntegers", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__FavouriteIntegers__NumericSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "NotNullIntFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, @@ -324,32 +324,32 @@ func TestSchemaAggregateInlineArrayCreatesUsersAverage(t *testing.T) { }, }, }, - map[string]interface{}{ + map[string]any{ "name": "_group", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__NumericSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "field", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, @@ -372,53 +372,53 @@ func TestSchemaAggregateInlineArrayCreatesUsersAverage(t *testing.T) { testUtils.ExecuteQueryTestCase(t, test) } -var aggregateGroupArg = map[string]interface{}{ +var aggregateGroupArg = map[string]any{ "name": "_group", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_key", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "IDOperatorBlock", }, }, - map[string]interface{}{ + map[string]any{ "name": "_not", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -427,21 +427,21 @@ var aggregateGroupArg = map[string]interface{}{ }, } -var aggregateVersionArg = map[string]interface{}{ +var aggregateVersionArg = map[string]any{ "name": "_version", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users___version__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -487,72 +487,72 @@ func TestSchemaAggregateInlineArrayCreatesUsersNillableBooleanCountFilter(t *tes } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "Favourites", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__Favourites__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "BooleanFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_eq", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Boolean", }, }, - map[string]interface{}{ + map[string]any{ "name": "_in", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_ne", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Boolean", }, }, - map[string]interface{}{ + map[string]any{ "name": "_nin", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -609,72 +609,72 @@ func TestSchemaAggregateInlineArrayCreatesUsersBooleanCountFilter(t *testing.T) } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "Favourites", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__Favourites__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "NotNullBooleanFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_eq", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Boolean", }, }, - map[string]interface{}{ + map[string]any{ "name": "_in", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_ne", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Boolean", }, }, - map[string]interface{}{ + map[string]any{ "name": "_nin", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -731,96 +731,96 @@ func TestSchemaAggregateInlineArrayCreatesUsersNillableIntegerCountFilter(t *tes } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "Favourites", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__Favourites__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "IntFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_eq", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_ge", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_gt", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_in", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_le", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_lt", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_ne", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_nin", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -877,96 +877,96 @@ func TestSchemaAggregateInlineArrayCreatesUsersIntegerCountFilter(t *testing.T) } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "Favourites", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__Favourites__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "NotNullIntFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_eq", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_ge", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_gt", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_in", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_le", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_lt", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_ne", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_nin", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -1023,96 +1023,96 @@ func TestSchemaAggregateInlineArrayCreatesUsersNillableFloatCountFilter(t *testi } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "Favourites", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__Favourites__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "FloatFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_eq", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_ge", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_gt", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_in", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_le", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_lt", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_ne", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_nin", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -1169,96 +1169,96 @@ func TestSchemaAggregateInlineArrayCreatesUsersFloatCountFilter(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "Favourites", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__Favourites__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "NotNullFloatFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_eq", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_ge", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_gt", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_in", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_le", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_lt", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_ne", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_nin", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -1315,72 +1315,72 @@ func TestSchemaAggregateInlineArrayCreatesUsersNillableStringCountFilter(t *test } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "Favourites", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__Favourites__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "StringFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_eq", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "String", }, }, - map[string]interface{}{ + map[string]any{ "name": "_in", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_ne", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "String", }, }, - map[string]interface{}{ + map[string]any{ "name": "_nin", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, @@ -1437,72 +1437,72 @@ func TestSchemaAggregateInlineArrayCreatesUsersStringCountFilter(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "Favourites", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__Favourites__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "NotNullStringFilterArg", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "_and", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_eq", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "String", }, }, - map[string]interface{}{ + map[string]any{ "name": "_in", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_ne", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "String", }, }, - map[string]interface{}{ + map[string]any{ "name": "_nin", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "_or", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "inputFields": nil, }, diff --git a/tests/integration/schema/aggregates/simple_test.go b/tests/integration/schema/aggregates/simple_test.go index 9b7ac5191f..37a322896c 100644 --- a/tests/integration/schema/aggregates/simple_test.go +++ b/tests/integration/schema/aggregates/simple_test.go @@ -45,53 +45,53 @@ func TestSchemaAggregateSimpleCreatesUsersCount(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "_group", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, }, }, }, - map[string]interface{}{ + map[string]any{ "name": "_version", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users___version__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, @@ -141,47 +141,47 @@ func TestSchemaAggregateSimpleCreatesUsersSum(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_sum", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "_group", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__NumericSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "field", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, "kind": "NON_NULL", - "ofType": map[string]interface{}{ + "ofType": map[string]any{ "name": "usersNumericFieldsArg", }, }, }, - map[string]interface{}{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", "kind": "INPUT_OBJECT", "ofType": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "kind": "SCALAR", "ofType": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "kind": "SCALAR", "ofType": nil, @@ -241,47 +241,47 @@ func TestSchemaAggregateSimpleCreatesUsersAverage(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__type": map[string]interface{}{ + ContainsData: map[string]any{ + "__type": map[string]any{ "name": "users", - "fields": []interface{}{ - map[string]interface{}{ + "fields": []any{ + map[string]any{ "name": "_avg", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "_group", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__NumericSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "field", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, "kind": "NON_NULL", - "ofType": map[string]interface{}{ + "ofType": map[string]any{ "name": "usersNumericFieldsArg", }, }, }, - map[string]interface{}{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", "kind": "INPUT_OBJECT", "ofType": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "kind": "SCALAR", "ofType": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "kind": "SCALAR", "ofType": nil, diff --git a/tests/integration/schema/aggregates/top_level_test.go b/tests/integration/schema/aggregates/top_level_test.go index 5a11b025e1..db1757b80d 100644 --- a/tests/integration/schema/aggregates/top_level_test.go +++ b/tests/integration/schema/aggregates/top_level_test.go @@ -46,33 +46,33 @@ func TestSchemaAggregateTopLevelCreatesCountGivenSchema(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__schema": map[string]interface{}{ - "queryType": map[string]interface{}{ - "fields": []interface{}{ - map[string]interface{}{ + ContainsData: map[string]any{ + "__schema": map[string]any{ + "queryType": map[string]any{ + "fields": []any{ + map[string]any{ "name": "_count", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "users", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__CountSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", }, }, @@ -124,47 +124,47 @@ func TestSchemaAggregateTopLevelCreatesSumGivenSchema(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__schema": map[string]interface{}{ - "queryType": map[string]interface{}{ - "fields": []interface{}{ - map[string]interface{}{ + ContainsData: map[string]any{ + "__schema": map[string]any{ + "queryType": map[string]any{ + "fields": []any{ + map[string]any{ "name": "_sum", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "users", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__NumericSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "field", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, "kind": "NON_NULL", - "ofType": map[string]interface{}{ + "ofType": map[string]any{ "name": "usersNumericFieldsArg", }, }, }, - map[string]interface{}{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", "kind": "INPUT_OBJECT", "ofType": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "kind": "SCALAR", "ofType": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "kind": "SCALAR", "ofType": nil, @@ -226,47 +226,47 @@ func TestSchemaAggregateTopLevelCreatesAverageGivenSchema(t *testing.T) { } } `, - ContainsData: map[string]interface{}{ - "__schema": map[string]interface{}{ - "queryType": map[string]interface{}{ - "fields": []interface{}{ - map[string]interface{}{ + ContainsData: map[string]any{ + "__schema": map[string]any{ + "queryType": map[string]any{ + "fields": []any{ + map[string]any{ "name": "_avg", - "args": []interface{}{ - map[string]interface{}{ + "args": []any{ + map[string]any{ "name": "users", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "users__NumericSelector", - "inputFields": []interface{}{ - map[string]interface{}{ + "inputFields": []any{ + map[string]any{ "name": "field", - "type": map[string]interface{}{ + "type": map[string]any{ "name": nil, "kind": "NON_NULL", - "ofType": map[string]interface{}{ + "ofType": map[string]any{ "name": "usersNumericFieldsArg", }, }, }, - map[string]interface{}{ + map[string]any{ "name": "filter", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "usersFilterArg", "kind": "INPUT_OBJECT", "ofType": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "limit", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "kind": "SCALAR", "ofType": nil, }, }, - map[string]interface{}{ + map[string]any{ "name": "offset", - "type": map[string]interface{}{ + "type": map[string]any{ "name": "Int", "kind": "SCALAR", "ofType": nil, diff --git a/tests/integration/schema/default_fields.go b/tests/integration/schema/default_fields.go index 65da9b6d90..722ad1c5cc 100644 --- a/tests/integration/schema/default_fields.go +++ b/tests/integration/schema/default_fields.go @@ -12,7 +12,7 @@ package schema import "sort" -type field = map[string]interface{} +type field = map[string]any type fields []field func concat(fieldSets ...fields) fields { @@ -35,7 +35,7 @@ func (fieldSet fields) append(field field) fields { // tidy sorts and casts the given fieldset into a format suitable // for comparing against introspection result fields. -func (fieldSet fields) tidy() []interface{} { +func (fieldSet fields) tidy() []any { return fieldSet.sort().array() } @@ -46,8 +46,8 @@ func (fieldSet fields) sort() fields { return fieldSet } -func (fieldSet fields) array() []interface{} { - result := make([]interface{}, len(fieldSet)) +func (fieldSet fields) array() []any { + result := make([]any, len(fieldSet)) for i, v := range fieldSet { result[i] = v } @@ -67,7 +67,7 @@ var defaultFields = concat( var keyField = field{ "name": "_key", - "type": map[string]interface{}{ + "type": map[string]any{ "kind": "SCALAR", "name": "ID", }, @@ -75,7 +75,7 @@ var keyField = field{ var versionField = field{ "name": "_version", - "type": map[string]interface{}{ + "type": map[string]any{ "kind": "LIST", "name": nil, }, @@ -83,30 +83,30 @@ var versionField = field{ var groupField = field{ "name": "_group", - "type": map[string]interface{}{ + "type": map[string]any{ "kind": "LIST", "name": nil, }, } var aggregateFields = fields{ - map[string]interface{}{ + map[string]any{ "name": "_avg", - "type": map[string]interface{}{ + "type": map[string]any{ "kind": "SCALAR", "name": "Float", }, }, - map[string]interface{}{ + map[string]any{ "name": "_count", - "type": map[string]interface{}{ + "type": map[string]any{ "kind": "SCALAR", "name": "Int", }, }, - map[string]interface{}{ + map[string]any{ "name": "_sum", - "type": map[string]interface{}{ + "type": map[string]any{ "kind": "SCALAR", "name": "Float", }, diff --git a/tests/integration/schema/simple_test.go b/tests/integration/schema/simple_test.go index 1810292ee7..ba108fb521 100644 --- a/tests/integration/schema/simple_test.go +++ b/tests/integration/schema/simple_test.go @@ -28,8 +28,8 @@ func TestSchemaSimpleCreatesSchemaGivenEmptyType(t *testing.T) { } } `, - ExpectedData: map[string]interface{}{ - "__type": map[string]interface{}{ + ExpectedData: map[string]any{ + "__type": map[string]any{ "name": "users", }, }, @@ -78,8 +78,8 @@ func TestSchemaSimpleCreatesSchemaGivenNewTypes(t *testing.T) { } } `, - ExpectedData: map[string]interface{}{ - "__type": map[string]interface{}{ + ExpectedData: map[string]any{ + "__type": map[string]any{ "name": "books", }, }, @@ -109,8 +109,8 @@ func TestSchemaSimpleCreatesSchemaWithDefaultFieldsGivenEmptyType(t *testing.T) } } `, - ExpectedData: map[string]interface{}{ - "__type": map[string]interface{}{ + ExpectedData: map[string]any{ + "__type": map[string]any{ "name": "users", "fields": defaultFields.tidy(), }, @@ -165,13 +165,13 @@ func TestSchemaSimpleCreatesSchemaGivenTypeWithStringField(t *testing.T) { } } `, - ExpectedData: map[string]interface{}{ - "__type": map[string]interface{}{ + ExpectedData: map[string]any{ + "__type": map[string]any{ "name": "users", "fields": defaultFields.append( field{ "name": "Name", - "type": map[string]interface{}{ + "type": map[string]any{ "kind": "SCALAR", "name": "String", }, diff --git a/tests/integration/schema/utils.go b/tests/integration/schema/utils.go index 917b83d9f3..c99c484251 100644 --- a/tests/integration/schema/utils.go +++ b/tests/integration/schema/utils.go @@ -34,7 +34,7 @@ type QueryTestCase struct { IntrospectionQuery string // The data expected to be returned from the introspection query. - ExpectedData map[string]interface{} + ExpectedData map[string]any // If [ExpectedData] is nil and this is populated, the test framework will assert // that the value given exists in the actual results. @@ -44,7 +44,7 @@ type QueryTestCase struct { // it will assert that the items in the expected-array have exact matches in the // corresponding result-array (inner maps are not traversed beyond the array, // the full array-item must match exactly). - ContainsData map[string]interface{} + ContainsData map[string]any // Any error expected to be returned by database calls. // @@ -96,7 +96,7 @@ func assertSchemaResults( if assertErrors(t, result.Errors, testCase.ExpectedError) { return true } - resultantData := result.Data.(map[string]interface{}) + resultantData := result.Data.(map[string]any) if len(testCase.ExpectedData) == 0 && len(testCase.ContainsData) == 0 { assert.Equal(t, testCase.ExpectedData, resultantData) @@ -117,21 +117,21 @@ func assertSchemaResults( // Asserts that the `actual` contains the given `contains` value according to the logic // described on the [QueryTestCase.ContainsData] property. -func assertContains(t *testing.T, contains map[string]interface{}, actual map[string]interface{}) { +func assertContains(t *testing.T, contains map[string]any, actual map[string]any) { for k, expected := range contains { innerActual := actual[k] - if innerExpected, innerIsMap := expected.(map[string]interface{}); innerIsMap { + if innerExpected, innerIsMap := expected.(map[string]any); innerIsMap { if innerActual == nil { assert.Equal(t, innerExpected, innerActual) - } else if innerActualMap, isMap := innerActual.(map[string]interface{}); isMap { + } else if innerActualMap, isMap := innerActual.(map[string]any); isMap { // If the inner is another map then we continue down the chain assertContains(t, innerExpected, innerActualMap) } else { // If the types don't match then we use assert.Equal for a clean failure message assert.Equal(t, innerExpected, innerActual) } - } else if innerExpected, innerIsArray := expected.([]interface{}); innerIsArray { - if actualArray, isActualArray := innerActual.([]interface{}); isActualArray { + } else if innerExpected, innerIsArray := expected.([]any); innerIsArray { + if actualArray, isActualArray := innerActual.([]any); isActualArray { // If the inner is an array/slice, then assert that each expected item is present // in the actual. Note how the actual may contain additional items - this should // not result in a test failure. @@ -167,7 +167,7 @@ func assertError(t *testing.T, err error, expectedError string) bool { func assertErrors( t *testing.T, - errors []interface{}, + errors []any, expectedError string, ) bool { if expectedError == "" { diff --git a/tests/integration/schema/with_inline_array_test.go b/tests/integration/schema/with_inline_array_test.go index dd27841be9..a8c2356ae9 100644 --- a/tests/integration/schema/with_inline_array_test.go +++ b/tests/integration/schema/with_inline_array_test.go @@ -30,8 +30,8 @@ func TestSchemaInlineArrayCreatesSchemaGivenSingleType(t *testing.T) { } } `, - ExpectedData: map[string]interface{}{ - "__type": map[string]interface{}{ + ExpectedData: map[string]any{ + "__type": map[string]any{ "name": "users", }, }, @@ -61,8 +61,8 @@ func TestSchemaInlineArrayCreatesSchemaGivenSecondType(t *testing.T) { } } `, - ExpectedData: map[string]interface{}{ - "__type": map[string]interface{}{ + ExpectedData: map[string]any{ + "__type": map[string]any{ "name": "books", }, }, diff --git a/tests/integration/utils.go b/tests/integration/utils.go index 9cac34ce1b..b0b4352ff5 100644 --- a/tests/integration/utils.go +++ b/tests/integration/utils.go @@ -73,7 +73,7 @@ type TransactionQuery struct { // The query to run against the transaction Query string // The expected (data) results of the query - Results []map[string]interface{} + Results []map[string]any // The expected error resulting from the query. Also checked against the txn commit. ExpectedError string } @@ -93,7 +93,7 @@ type QueryTestCase struct { // of changes in strinigied JSON format Updates map[int]map[int][]string - Results []map[string]interface{} + Results []map[string]any // The expected content of an expected error ExpectedError string @@ -613,7 +613,7 @@ func assertQueryResults( t *testing.T, description string, result *client.QueryResult, - expectedResults []map[string]interface{}, + expectedResults []map[string]any, expectedError string, ) bool { if assertErrors(t, description, result.Errors, expectedError) { @@ -621,7 +621,7 @@ func assertQueryResults( } // Note: if result.Data == nil this panics (the panic seems useful while testing). - resultantData := result.Data.([]map[string]interface{}) + resultantData := result.Data.([]map[string]any) log.Info(ctx, "", logging.NewKV("QueryResults", result.Data)) @@ -663,7 +663,7 @@ func assertError(t *testing.T, description string, err error, expectedError stri func assertErrors( t *testing.T, description string, - errors []interface{}, + errors []any, expectedError string, ) bool { if expectedError == "" {