Skip to content

Commit e1496cd

Browse files
authored
go.mod: migrate to github.com/go-viper/mapstructure/v2 v2.0.0 (#635)
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 <[email protected]>
1 parent 76507d2 commit e1496cd

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ require (
66
github.com/distribution/reference v0.5.0
77
github.com/docker/go-connections v0.4.0
88
github.com/docker/go-units v0.5.0
9+
github.com/go-viper/mapstructure/v2 v2.0.0
910
github.com/google/go-cmp v0.5.9
1011
github.com/mattn/go-shellwords v1.0.12
1112
github.com/mitchellh/copystructure v1.2.0
12-
github.com/mitchellh/mapstructure v1.5.0
1313
github.com/opencontainers/go-digest v1.0.0
1414
github.com/sirupsen/logrus v1.9.0
1515
github.com/stretchr/testify v1.8.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh
77
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
88
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
99
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
10+
github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc=
11+
github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
1012
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
1113
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
1214
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1315
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
1416
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
1517
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
1618
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
17-
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
18-
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
1919
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
2020
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
2121
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=

loader/loader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
"github.com/compose-spec/compose-go/v2/tree"
4040
"github.com/compose-spec/compose-go/v2/types"
4141
"github.com/compose-spec/compose-go/v2/validation"
42-
"github.com/mitchellh/mapstructure"
42+
"github.com/go-viper/mapstructure/v2"
4343
"github.com/sirupsen/logrus"
4444
"golang.org/x/exp/slices"
4545
"gopkg.in/yaml.v3"

loader/mapstructure_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"testing"
2121

2222
"github.com/compose-spec/compose-go/v2/types"
23-
"github.com/mitchellh/mapstructure"
23+
"github.com/go-viper/mapstructure/v2"
2424
"gotest.tools/v3/assert"
2525
)
2626

parsing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ volumes:
161161
# Phase 15: go binding
162162

163163
Eventually, the yaml tree can be unmarshalled into go structs. We rely on
164-
[mapstructure](https://github.com/mitchellh/mapstructure) library for this purpose.
164+
[mapstructure](https://github.com/go-viper/mapstructure/) library for this purpose.
165165
Decoder is configured so that custom decode function can be defined by target type,
166166
allowing type conversions. For example, byte units (`640k`) and durations set in yaml
167167
as plain string are actually modeled in go types as `int64`.

transform/ports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
"github.com/compose-spec/compose-go/v2/tree"
2323
"github.com/compose-spec/compose-go/v2/types"
24-
"github.com/mitchellh/mapstructure"
24+
"github.com/go-viper/mapstructure/v2"
2525
)
2626

2727
func transformPorts(data any, p tree.Path, ignoreParseError bool) (any, error) {

types/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"runtime"
2222
"strings"
2323

24-
"github.com/mitchellh/mapstructure"
24+
"github.com/go-viper/mapstructure/v2"
2525
)
2626

2727
var (

0 commit comments

Comments
 (0)