Skip to content

Commit

Permalink
refactor(conf): avoid type assertion in map case branch
Browse files Browse the repository at this point in the history
Simplifies the code by using the type switch variable binding instead of
performing an additional type assertion.

Signed-off-by: Ville Vesilehto <[email protected]>
  • Loading branch information
thevilledev committed Jan 24, 2025
1 parent 192ab82 commit 4fd9673
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conf/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4fd9673

Please sign in to comment.