From da55858fffe6093e995244bfc0aa2d9fba370e30 Mon Sep 17 00:00:00 2001 From: Wade Carpenter Date: Thu, 5 May 2022 10:50:15 -0700 Subject: [PATCH] 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. --- viper.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/viper.go b/viper.go index 8606ab6..a3812e9 100644 --- a/viper.go +++ b/viper.go @@ -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 } @@ -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)