mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
chore: modernize some code
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user