config: Refactor parsed option handling

Validate the parsed options directly after read and inform about errors.
This commit is contained in:
Jöran Karl
2024-07-23 22:33:16 +02:00
parent 395d848980
commit 4663927098
4 changed files with 90 additions and 39 deletions

View File

@@ -9,6 +9,10 @@ import (
)
func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error {
if err := config.OptionIsValid(option, nativeValue); err != nil {
return err
}
if reflect.DeepEqual(b.Settings[option], nativeValue) {
return nil
}