mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
refactor(conf): avoid type assertion in map case branch (#749)
Simplifies the code by using the type switch variable binding instead of performing an additional type assertion. Signed-off-by: Ville Vesilehto <[email protected]> Co-authored-by: Anton Medvedev <[email protected]>
This commit is contained in:
committed by
GitHub
co-authored by
Anton Medvedev
parent
f1b80c01df
commit
45bc3f7595
+2
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user