diff --git a/confmap/confmap.go b/confmap/confmap.go index dad21b250d2..a22cb5c9c14 100644 --- a/confmap/confmap.go +++ b/confmap/confmap.go @@ -161,7 +161,7 @@ func decodeConfig(m *Conf, result interface{}, errorUnused bool) error { Result: result, TagName: "mapstructure", WeaklyTypedInput: true, - MatchName: caseSensitiveMatchName(), + MatchName: caseSensitiveMatchName, DecodeHook: mapstructure.ComposeDecodeHookFunc( expandNilStructPointersHookFunc(), mapstructure.StringToSliceHookFunc(","), @@ -193,8 +193,8 @@ func encoderConfig(rawVal interface{}) *encoder.EncoderConfig { // case-sensitive version of the callback to be used in the MatchName property // of the DecoderConfig. The default for MatchEqual is to use strings.EqualFold, // which is case-insensitive. -func caseSensitiveMatchName() func(a, b string) bool { - return func(a, b string) bool { return a == b } +func caseSensitiveMatchName(a, b string) bool { + return a == b } // In cases where a config has a mapping of something to a struct pointers