From 4fd967340163b0686270a850041b9d90104134e5 Mon Sep 17 00:00:00 2001 From: Ville Vesilehto Date: Fri, 24 Jan 2025 21:12:53 +0200 Subject: [PATCH] refactor(conf): avoid type assertion in map case branch Simplifies the code by using the type switch variable binding instead of performing an additional type assertion. Signed-off-by: Ville Vesilehto --- conf/env.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/env.go b/conf/env.go index 494bb5b7..99e2f462 100644 --- a/conf/env.go +++ b/conf/env.go @@ -46,9 +46,9 @@ func Env(env any) Nature { face := elem.Interface() - switch face.(type) { + switch face := face.(type) { case types.Map: - n.Fields[key.String()] = face.(types.Map).Nature() + n.Fields[key.String()] = face.Nature() default: if face == nil {