Skip to content

Commit

Permalink
Merge pull request #130 from robinbraemer/cleaning
Browse files Browse the repository at this point in the history
eliminate a type assertion
  • Loading branch information
knadh committed Jan 13, 2022
2 parents c961b5a + c3c71af commit 908849d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maps/maps.go
Expand Up @@ -215,9 +215,9 @@ func Search(mp map[string]interface{}, path []string) interface{} {
if len(path) == 1 {
return next
}
switch next.(type) {
switch m := next.(type) {
case map[string]interface{}:
return Search(next.(map[string]interface{}), path[1:])
return Search(m, path[1:])
default:
return nil
} //
Expand Down

0 comments on commit 908849d

Please sign in to comment.