compose-spec / compose-go

Reference library for parsing and loading Compose YAML files
https://compose-spec.io
Apache License 2.0
355 stars 112 forks source link

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

Closed thaJeztah closed 4 months ago

thaJeztah commented 4 months ago

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

ndeloof commented 4 months ago

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 commented 4 months ago

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 :smile: