From 97b5bb007f2c792fec9b5a00f752e4a0c7efb14e Mon Sep 17 00:00:00 2001 From: Craig MacKenzie Date: Tue, 5 Jul 2022 13:29:32 -0400 Subject: [PATCH] Restore original Clone() type conversion behavvior. --- CHANGELOG.md | 6 ++++++ mapstr/mapstr.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41a8c9e8..d53ee3c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Fixed +## [0.2.9] + +### Changed + +- Fix breaking change to mapstr type conversions during Clone(). + ## [0.2.8] ### Changed diff --git a/mapstr/mapstr.go b/mapstr/mapstr.go index d8884c29..39b7fd3f 100644 --- a/mapstr/mapstr.go +++ b/mapstr/mapstr.go @@ -155,7 +155,7 @@ func (m M) Clone() M { result := make(M, len(m)) for k := range m { - if innerMap, ok := (m[k]).(M); ok { + if innerMap, ok := tryToMapStr(m[k]); ok { result[k] = innerMap.Clone() } else { result[k] = m[k]