From c86db3585ecf707d9c5dab5e7f3222dde761060e Mon Sep 17 00:00:00 2001 From: Oskar Hahn Date: Wed, 14 Feb 2024 16:08:29 +0100 Subject: [PATCH] Fix tests --- pkg/datastore/dsmock/yaml_data.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/datastore/dsmock/yaml_data.go b/pkg/datastore/dsmock/yaml_data.go index 249a3ee81..325363621 100644 --- a/pkg/datastore/dsmock/yaml_data.go +++ b/pkg/datastore/dsmock/yaml_data.go @@ -29,13 +29,13 @@ func YAMLData(input string) map[dskey.Key][]byte { parts := strings.Split(dbKey, "/") switch len(parts) { case 1: - map1, ok := dbValue.(map[interface{}]interface{}) + map1, ok := dbValue.(map[string]interface{}) if !ok { panic(fmt.Errorf("invalid type in db key %s: %T", dbKey, dbValue)) } for rawID, rawObject := range map1 { - id, ok := rawID.(int) - if !ok { + id, err := strconv.Atoi(rawID) + if err != nil { panic(fmt.Errorf("invalid id type: got %T expected int", rawID)) } field, ok := rawObject.(map[string]interface{})