Skip to content

Commit

Permalink
chore: fix Error log calls in mergeMaps
Browse files Browse the repository at this point in the history
The logger interface uses k,v pairs, but it was being called with a
format string, here.

Changed to use k,v pairs.

I didn't find any other instances of this problem.
  • Loading branch information
wwade authored and sagikazarmark committed May 26, 2022
1 parent f50ce90 commit da55858
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions viper.go
Expand Up @@ -1809,8 +1809,13 @@ func mergeMaps(
tsv, ok := sv.(map[interface{}]interface{})
if !ok {
v.logger.Error(
"Could not cast sv to map[interface{}]interface{}; key=%s, st=%v, tt=%v, sv=%v, tv=%v",
sk, svType, tvType, sv, tv)
"Could not cast sv to map[interface{}]interface{}",
"key", sk,
"st", svType,
"tt", tvType,
"sv", sv,
"tv", tv,
)
continue
}

Expand All @@ -1822,8 +1827,13 @@ func mergeMaps(
tsv, ok := sv.(map[string]interface{})
if !ok {
v.logger.Error(
"Could not cast sv to map[string]interface{}; key=%s, st=%v, tt=%v, sv=%v, tv=%v",
sk, svType, tvType, sv, tv)
"Could not cast sv to map[string]interface{}",
"key", sk,
"st", svType,
"tt", tvType,
"sv", sv,
"tv", tv,
)
continue
}
mergeMaps(tsv, ttv, nil)
Expand Down

0 comments on commit da55858

Please sign in to comment.