chore: modernize some code

This commit is contained in:
Vincent Bernat
2025-11-14 23:11:53 +01:00
parent 625387a617
commit abca5e983d
21 changed files with 42 additions and 63 deletions

View File

@@ -66,9 +66,8 @@ func (config TLSConfiguration) MakeTLSConfig() (*tls.Config, error) {
// RenameKeyUnmarshallerHook move a configuration setting from one place to another.
func tlsUnmarshallerHook() mapstructure.DecodeHookFunc {
var zeroConfiguration TLSConfiguration
return func(from, to reflect.Value) (any, error) {
if from.Kind() != reflect.Map || from.IsNil() || to.Type() != reflect.TypeOf(zeroConfiguration) {
if from.Kind() != reflect.Map || from.IsNil() || to.Type() != reflect.TypeFor[TLSConfiguration]() {
return from.Interface(), nil
}