Skip to content

Commit

Permalink
Fix initialisation of empty maps
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWright committed Mar 22, 2021
1 parent 69e9072 commit 47aa6ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion node_query_multiple.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}{})
}
Expand Down

0 comments on commit 47aa6ce

Please sign in to comment.