Skip to content

Commit 71f9852

Browse files
authored
go: use go-viper/mapstructure/v2 over archived mitchellh/mapstructure (#606)
1 parent 1696e08 commit 71f9852

File tree

7 files changed

+9
-6
lines changed

7 files changed

+9
-6
lines changed

entproto/enum.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"regexp"
2121
"strings"
2222

23-
"github.com/mitchellh/mapstructure"
23+
"github.com/go-viper/mapstructure/v2"
2424

2525
"entgo.io/ent/entc/gen"
2626
)

entproto/field.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
"entgo.io/ent/entc/gen"
2121
"entgo.io/ent/schema"
22-
"github.com/mitchellh/mapstructure"
22+
"github.com/go-viper/mapstructure/v2"
2323
"google.golang.org/protobuf/types/descriptorpb"
2424
)
2525

entproto/message.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
"entgo.io/ent/entc/gen"
2121
"entgo.io/ent/schema"
22-
"github.com/mitchellh/mapstructure"
22+
"github.com/go-viper/mapstructure/v2"
2323
)
2424

2525
const MessageAnnotation = "ProtoMessage"

entproto/service.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
"entgo.io/ent/entc/gen"
2222
"entgo.io/ent/schema"
23-
"github.com/mitchellh/mapstructure"
23+
"github.com/go-viper/mapstructure/v2"
2424
"google.golang.org/protobuf/types/descriptorpb"
2525
_ "google.golang.org/protobuf/types/known/emptypb"
2626
)

go.mod

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ require (
88
github.com/AlekSi/pointer v1.1.0
99
github.com/alecthomas/kong v0.7.0
1010
github.com/go-openapi/inflect v0.19.0
11+
github.com/go-viper/mapstructure/v2 v2.2.1
1112
github.com/google/uuid v1.6.0
1213
github.com/hashicorp/go-multierror v1.1.1
1314
github.com/jhump/protoreflect v1.10.1
1415
github.com/mattn/go-sqlite3 v1.14.16
15-
github.com/mitchellh/mapstructure v1.5.0
1616
github.com/ogen-go/ogen v0.56.1
1717
github.com/oklog/ulid/v2 v2.0.2
1818
github.com/stoewer/go-strcase v1.2.0
@@ -51,6 +51,7 @@ require (
5151
github.com/mattn/go-colorable v0.1.13 // indirect
5252
github.com/mattn/go-isatty v0.0.20 // indirect
5353
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
54+
github.com/mitchellh/mapstructure v1.5.0 // indirect
5455
github.com/pmezard/go-difflib v1.0.0 // indirect
5556
github.com/segmentio/asm v1.2.0 // indirect
5657
github.com/sosodev/duration v1.3.1 // indirect

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNP
5959
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
6060
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
6161
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
62+
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
63+
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
6264
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
6365
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
6466
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=

schemast/annotation.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"entgo.io/contrib/entproto"
2323
"entgo.io/ent/dialect/entsql"
2424
"entgo.io/ent/schema"
25-
"github.com/mitchellh/mapstructure"
25+
"github.com/go-viper/mapstructure/v2"
2626
"google.golang.org/protobuf/types/descriptorpb"
2727
)
2828

0 commit comments

Comments
 (0)