From 47aa6ce2803b857d0ef436f7584e9e4277e03073 Mon Sep 17 00:00:00 2001 From: Tom Wright Date: Mon, 22 Mar 2021 09:44:26 +0000 Subject: [PATCH] Fix initialisation of empty maps --- CHANGELOG.md | 9 ++++++++- node_query_multiple.go | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5767d522..230b9871 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nothing yet. +## [v1.13.5] - 2021-03-22 + +### Fixed + +- Empty map values are now initialised as `map[string]interface{}` rather than `map[interface{}]interface{}`. + ## [v1.13.4] - 2021-03-11 ### Fixed @@ -276,7 +282,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Everything! -[unreleased]: https://github.com/TomWright/dasel/compare/v1.13.4...HEAD +[unreleased]: https://github.com/TomWright/dasel/compare/v1.13.5...HEAD +[v1.13.5]: https://github.com/TomWright/dasel/compare/v1.13.4...v1.13.5 [v1.13.4]: https://github.com/TomWright/dasel/compare/v1.13.3...v1.13.4 [v1.13.3]: https://github.com/TomWright/dasel/compare/v1.13.2...v1.13.3 [v1.13.2]: https://github.com/TomWright/dasel/compare/v1.13.1...v1.13.2 diff --git a/node_query_multiple.go b/node_query_multiple.go index 4f8a00bb..be27eccd 100644 --- a/node_query_multiple.go +++ b/node_query_multiple.go @@ -419,7 +419,7 @@ func findNodesAnyIndex(selector Selector, previousValue reflect.Value) ([]*Node, func initialiseEmptyValue(selector Selector, previousValue reflect.Value) reflect.Value { switch selector.Type { case "PROPERTY": - return reflect.ValueOf(map[interface{}]interface{}{}) + return reflect.ValueOf(map[string]interface{}{}) case "INDEX", "NEXT_AVAILABLE_INDEX", "INDEX_ANY", "DYNAMIC": return reflect.ValueOf([]interface{}{}) }