From 19785a02618992157f42fe169f9c4d7de9d3a5b3 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 23 Feb 2024 20:31:34 -0800 Subject: [PATCH] [confmap] use github.com/go-viper/mapstructure/v2 --- .chloggen/update_mapstructure.yaml | 26 +++++++++++++++++++ confmap/confmap.go | 2 +- confmap/internal/mapstructure/encoder.go | 2 +- confmap/internal/mapstructure/encoder_test.go | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100755 .chloggen/update_mapstructure.yaml diff --git a/.chloggen/update_mapstructure.yaml b/.chloggen/update_mapstructure.yaml new file mode 100755 index 00000000000..93fd5d7da6d --- /dev/null +++ b/.chloggen/update_mapstructure.yaml @@ -0,0 +1,26 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: confmap + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Update mapstructure to use a maintained fork, github.com/go-viper/mapstructure/v2. + +# One or more tracking issues or pull requests related to the change +issues: [9634] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: | + See https://github.com/mitchellh/mapstructure/issues/349 for context. + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/confmap/confmap.go b/confmap/confmap.go index 9664109f9ab..213e4a332d9 100644 --- a/confmap/confmap.go +++ b/confmap/confmap.go @@ -8,10 +8,10 @@ import ( "fmt" "reflect" + "github.com/go-viper/mapstructure/v2" "github.com/knadh/koanf/maps" "github.com/knadh/koanf/providers/confmap" "github.com/knadh/koanf/v2" - "github.com/mitchellh/mapstructure" encoder "go.opentelemetry.io/collector/confmap/internal/mapstructure" ) diff --git a/confmap/internal/mapstructure/encoder.go b/confmap/internal/mapstructure/encoder.go index feb5eefa76b..408560e2262 100644 --- a/confmap/internal/mapstructure/encoder.go +++ b/confmap/internal/mapstructure/encoder.go @@ -10,7 +10,7 @@ import ( "reflect" "strings" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" ) const ( diff --git a/confmap/internal/mapstructure/encoder_test.go b/confmap/internal/mapstructure/encoder_test.go index b557c91735a..fac12e8a6df 100644 --- a/confmap/internal/mapstructure/encoder_test.go +++ b/confmap/internal/mapstructure/encoder_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/mitchellh/mapstructure" + "github.com/go-viper/mapstructure/v2" "github.com/stretchr/testify/require" )