Skip to content

go.mod: migrate to github.com/go-viper/mapstructure/v2 v2.0.0#635

Merged
laurazard merged 1 commit intocompose-spec:mainfrom
thaJeztah:migrate_mapstructure
Jun 3, 2024
Merged

go.mod: migrate to github.com/go-viper/mapstructure/v2 v2.0.0#635
laurazard merged 1 commit intocompose-spec:mainfrom
thaJeztah:migrate_mapstructure

Conversation

@thaJeztah
Copy link
Member

github.com/mitchellh/mapstructure will no longer be maintained by the author, and github.com/go-viper/mapstructure is nominated as the endorsed fork.

Breaking changes

Error is removed in favor of errors.Join (backported from Go 1.20 to preserve compatibility with earlier versions)

What's Changed

  • feat!: update module path
  • build: update dev env
  • feature: add StringToBasicTypeHookFunc and support complex
  • Add an example showing how to use a DecodeHookFunc to parse a custom field.
  • Remove exposed error type
  • Replace internal joined error with errors.Join

github.com/mitchellh/mapstructure will no longer be maintained by the author,
and github.com/go-viper/mapstructure is nominated as the endorsed fork.

- v1.x changes since last release from mitchellh: go-viper/mapstructure@v1.5.0...v1.6.0
- v2.0 changes: go-viper/mapstructure@v1.6.0...v2.0.0

Breaking changes

Error is removed in favor of errors.Join (backported from Go 1.20 to preserve
compatibility with earlier versions)

What's Changed

- feat!: update module path
- build: update dev env
- feature: add StringToBasicTypeHookFunc and support complex
- Add an example showing how to use a DecodeHookFunc to parse a custom field.
- Remove exposed error type
- Replace internal joined error with errors.Join

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah requested a review from ndeloof as a code owner June 3, 2024 08:45
@ndeloof
Copy link
Collaborator

ndeloof commented Jun 3, 2024

Nice!
I was worried with this dependency being unmaintained.

That being said, with compose-go to be able to process most of the parse/interpolate/merge process in plain yaml, I think we could eventually get rid of this library by marshaling back the processed compose model into yaml and load it into go structs with a plain yaml.Unmarshal. Doing so we would have a more explicit "pre-processing" phase (shared with docker compose config) then load into go structs, which should be considered an "implementation detail"

@thaJeztah
Copy link
Member Author

That being said, with compose-go to be able to process most of the parse/interpolate/merge process in plain yaml, I think we could eventually get rid of this library

I haven't looked closely where it's all used, but yes, if we can get rid of a dependency altogether, that's always good!

I think I noticed this one being mentioned when Mitchell announced he'd be deprecating various of his repositories, and I had a draft in docker/cli for some time. Now that the fork did a v2.0.0 (non-beta) release, I went looking where else it was used, and found it was used here 😄

Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants