Skip to content

Commit fa20a0c

Browse files
authored
[chore][confmap] run make modernize (#14157)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Run the `make modernize` tool. https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize This is part of the process to enable the [modernize](#14153) linter in CI. There are no changes in the component behaviour. Signed-off-by: Paulo Dias <[email protected]>
1 parent 6fb786c commit fa20a0c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

confmap/internal/decoder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func mapKeyStringToMapKeyTextUnmarshalerHookFunc() mapstructure.DecodeHookFuncTy
168168
}
169169

170170
// Create a map with key value of to's key to bool.
171-
fieldNameSet := reflect.MakeMap(reflect.MapOf(to.Key(), reflect.TypeOf(true)))
171+
fieldNameSet := reflect.MakeMap(reflect.MapOf(to.Key(), reflect.TypeFor[bool]()))
172172
for k := range data.(map[string]any) {
173173
// Create a new value of the to's key type.
174174
tKey := reflect.New(to.Key())

confmap/xconfmap/config.go

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

1616
// As interface types are only used for static typing, a common idiom to find the reflection Type
1717
// for an interface type Foo is to use a *Foo value.
18-
var configValidatorType = reflect.TypeOf((*Validator)(nil)).Elem()
18+
var configValidatorType = reflect.TypeFor[Validator]()
1919

2020
// Validator defines an optional interface for configurations to implement to do validation.
2121
type Validator interface {

0 commit comments

Comments
 (0)