GenerateKeyMap() now changes KEY_MAP according to the config file

This commit is contained in:
aditya-K2 2021-11-11 23:58:57 +05:30
parent 3492ec9349
commit 0fa68fe7b0

View File

@ -37,7 +37,15 @@ func ReadConfig() {
func GenerateKeyMap(funcMap map[string]func()) {
for k := range funcMap {
fmt.Println(k, " : ", viper.GetStringSlice(k))
mappingsForFunctionK := viper.GetStringSlice(k)
if len(mappingsForFunctionK) != 0 {
for _, i := range mappingsForFunctionK {
aV, err := GetAsciiValue(i)
if err == nil {
KEY_MAP[aV] = k
}
}
}
}
}