Skip to content

Commit 8eacab6

Browse files
committed
cell: 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]: mitchellh/mapstructure#349 [^2]: https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc Signed-off-by: Tobias Klauser <tobias@cilium.io>
1 parent 7f3c86c commit 8eacab6

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

cell/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"strings"
1111

1212
"github.com/cilium/hive/internal"
13-
"github.com/mitchellh/mapstructure"
13+
"github.com/go-viper/mapstructure/v2"
1414
"github.com/spf13/pflag"
1515
"go.uber.org/dig"
1616
)
@@ -41,7 +41,7 @@ type Flagger interface {
4141
// Exported fields that are not found from the viper settings will cause
4242
// hive.Run() to fail. Unexported fields are ignored.
4343
//
44-
// See https://pkg.go.dev/github.com/mitchellh/mapstructure for more info.
44+
// See https://pkg.go.dev/github.com/go-viper/mapstructure/v2 for more info.
4545
Flags(*pflag.FlagSet)
4646
}
4747

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ go 1.21.3
55
require (
66
github.com/cilium/stream v0.0.0-20240209152734-a0792b51812d
77
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
8-
github.com/mitchellh/mapstructure v1.5.0
8+
github.com/go-viper/mapstructure/v2 v2.2.1
99
github.com/spf13/cast v1.6.0
1010
github.com/spf13/cobra v1.8.0
1111
github.com/spf13/pflag v1.0.5
1212
github.com/spf13/viper v1.18.2
1313
github.com/stretchr/testify v1.8.4
1414
go.uber.org/dig v1.17.1
1515
go.uber.org/goleak v1.3.0
16+
golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb
17+
golang.org/x/sys v0.15.0
1618
golang.org/x/term v0.15.0
1719
golang.org/x/tools v0.16.0
1820
)
@@ -23,6 +25,7 @@ require (
2325
github.com/hashicorp/hcl v1.0.0 // indirect
2426
github.com/inconshreveable/mousetrap v1.1.0 // indirect
2527
github.com/magiconair/properties v1.8.7 // indirect
28+
github.com/mitchellh/mapstructure v1.5.0 // indirect
2629
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
2730
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
2831
github.com/rogpeppe/go-internal v1.11.0 // indirect
@@ -32,8 +35,6 @@ require (
3235
github.com/spf13/afero v1.11.0 // indirect
3336
github.com/subosito/gotenv v1.6.0 // indirect
3437
go.uber.org/multierr v1.11.0 // indirect
35-
golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb // indirect
36-
golang.org/x/sys v0.15.0 // indirect
3738
golang.org/x/text v0.14.0 // indirect
3839
golang.org/x/time v0.5.0 // indirect
3940
gopkg.in/ini.v1 v1.67.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
99
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
1010
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
1111
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
12+
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
13+
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
1214
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1315
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1416
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=

0 commit comments

Comments
 (0)