From 30975787b20993629d0572993f552f2ca34316be Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Sat, 29 Apr 2023 16:05:19 +0530 Subject: [PATCH] Fix error with interface types --- config/config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.go b/config/config.go index 6808e24..85fde18 100644 --- a/config/config.go +++ b/config/config.go @@ -174,13 +174,13 @@ func ReadConfig() { func GenerateMappings() map[string]map[string]map[Key]string { all := viper.GetStringMap("mappings") keys := DefaultMappings - for view, mode := range all { + for view, modes := range all { if keys[view] == nil { keys[view] = make(map[string]map[Key]string) } - for modeName, mappings := range mode.(map[string]map[string]string) { - for key, function := range mappings { - keys[view][modeName][NewKey(key)] = function + for mode, mappings := range modes.(map[string]interface{}) { + for function, key := range mappings.(map[string]interface{}) { + keys[view][mode][NewKey(key.(string))] = function } } }