Repository: go-openapi/strfmt
Pull request #157 (2025-04-10 10:43:23)

Migrate to github.com/go-viper/mapstructure/v2
The github.com/mitchellh/mapstructure package is archived and no longer receives updates[^1]. The "blessed" fork[^2] is
github.com/go-viper/mapstructure. The API is the same, so nothing needs to be changed apart from the import path.

[^1]: https://github.com/mitchellh/mapstructure/issues/349
[^2]: https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc

fredbi: Thanks. If I remember correctly we have this dependency in other repos for go-openapi and go-swagger. Have to check
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/go-openapi/strfmt/pull/157?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 82.87%. Comparing base [(`3dbbafa`)](https://app.codecov.io/gh/go-openapi/strfmt/commit/3dbbafa8d8a7392ca0159b7cefb4b3d31dbb146b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) to head [(`f435566`)](https://app.codecov.io/gh/go-openapi/strfmt/commit/f43556693310691c7d61568fd2f1a3bb9064f279?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi).

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           master     #157   +/-   ##
=======================================
  Coverage   82.87%   82.87%           
=======================================
  Files          13       13           
  Lines        2178     2178           
=======================================
  Hits         1805     1805           
  Misses        295      295           
  Partials       78       78           
```

| [Flag](https://app.codecov.io/gh/go-openapi/strfmt/pull/157/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | Coverage Δ | |
|---|---|---|
| [oldstable-macos-latest](https://app.codecov.io/gh/go-openapi/strfmt/pull/157/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `82.87% <ø> (ø)` | |
| [oldstable-ubuntu-latest](https://app.codecov.io/gh/go-openapi/strfmt/pull/157/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `82.87% <ø> (ø)` | |
| [oldstable-windows-latest](https://app.codecov.io/gh/go-openapi/strfmt/pull/157/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `?` | |
| [stable-macos-latest](https://app.codecov.io/gh/go-openapi/strfmt/pull/157/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `82.87% <ø> (ø)` | |
| [stable-ubuntu-latest](https://app.codecov.io/gh/go-openapi/strfmt/pull/157/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `?` | |
| [stable-windows-latest](https://app.codecov.io/gh/go-openapi/strfmt/pull/157/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi) | `?` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi#carryforward-flags-in-the-pull-request-comment) to find out more.

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/go-openapi/strfmt/pull/157?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=go-openapi).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>

Patch:
diff --git a/format.go b/format.go
index 2c45cd2..75d4b60 100644
--- a/format.go
+++ b/format.go
@@ -23,7 +23,7 @@ import (
 	"time"
 
 	"github.com/go-openapi/errors"
-	"github.com/mitchellh/mapstructure"
+	"github.com/go-viper/mapstructure/v2"
 )
 
 // Default is the default formats registry
diff --git a/go.mod b/go.mod
index 0197c5c..a5276b4 100644
--- a/go.mod
+++ b/go.mod
@@ -3,8 +3,8 @@ module github.com/go-openapi/strfmt
 require (
 	github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
 	github.com/go-openapi/errors v0.22.1
+	github.com/go-viper/mapstructure/v2 v2.2.1
 	github.com/google/uuid v1.6.0
-	github.com/mitchellh/mapstructure v1.5.0
 	github.com/oklog/ulid v1.3.1
 	github.com/stretchr/testify v1.10.0
 	go.mongodb.org/mongo-driver v1.17.3
diff --git a/go.sum b/go.sum
index afc837e..701b0fa 100644
--- a/go.sum
+++ b/go.sum
@@ -4,12 +4,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/go-openapi/errors v0.22.1 h1:kslMRRnK7NCb/CvR1q1VWuEQCEIsBGn5GgKD9e+HYhU=
 github.com/go-openapi/errors v0.22.1/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0=
+github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
+github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
 github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
 github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
 github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
-github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
-github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
 github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
 github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=


Test patch:
diff --git a/format_test.go b/format_test.go
index 65882b5..6693cc2 100644
--- a/format_test.go
+++ b/format_test.go
@@ -19,7 +19,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/mitchellh/mapstructure"
+	"github.com/go-viper/mapstructure/v2"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 )