Skip to content

Commit da55858

Browse files
wwadesagikazarmark
authored andcommitted
chore: fix Error log calls in mergeMaps
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.
1 parent f50ce90 commit da55858

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

viper.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,8 +1809,13 @@ func mergeMaps(
18091809
tsv, ok := sv.(map[interface{}]interface{})
18101810
if !ok {
18111811
v.logger.Error(
1812-
"Could not cast sv to map[interface{}]interface{}; key=%s, st=%v, tt=%v, sv=%v, tv=%v",
1813-
sk, svType, tvType, sv, tv)
1812+
"Could not cast sv to map[interface{}]interface{}",
1813+
"key", sk,
1814+
"st", svType,
1815+
"tt", tvType,
1816+
"sv", sv,
1817+
"tv", tv,
1818+
)
18141819
continue
18151820
}
18161821

@@ -1822,8 +1827,13 @@ func mergeMaps(
18221827
tsv, ok := sv.(map[string]interface{})
18231828
if !ok {
18241829
v.logger.Error(
1825-
"Could not cast sv to map[string]interface{}; key=%s, st=%v, tt=%v, sv=%v, tv=%v",
1826-
sk, svType, tvType, sv, tv)
1830+
"Could not cast sv to map[string]interface{}",
1831+
"key", sk,
1832+
"st", svType,
1833+
"tt", tvType,
1834+
"sv", sv,
1835+
"tv", tv,
1836+
)
18271837
continue
18281838
}
18291839
mergeMaps(tsv, ttv, nil)

0 commit comments

Comments
 (0)