TryBindKey: ensure returning false if the binding wasn't successful

Return false if there is already a binding for the given key, different
from the requested binding, and we haven't replaced it with the requested
binding due to overwrite set to false.
This commit is contained in:
Dmytro Maluka 2024-07-14 15:00:38 +02:00
parent 37b5284005
commit bcc8e1812c

View File

@ -298,7 +298,7 @@ func TryBindKey(k, v string, overwrite bool) (bool, error) {
if overwrite {
parsed[ev] = v
} else {
return true, nil
return parsed[ev] == v, nil
}
} else {
parsed[k] = v