mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-08-27 20:36:29 -04:00
Implement error messages for missing key values in libmutton.ini
This commit is contained in:
@@ -19,7 +19,15 @@ func ReadConfig(readKeys []string) []string {
|
||||
var config []string
|
||||
|
||||
for _, key := range readKeys {
|
||||
config = append(config, cfg.Section("LIBMUTTON").Key(key).String())
|
||||
keyConfig := cfg.Section("LIBMUTTON").Key(key).String()
|
||||
|
||||
// ensure specified key has a value
|
||||
if keyConfig == "" {
|
||||
fmt.Println(AnsiError + "Failed to find value for key \"" + key + "\" in section \"[LIBMUTTON]\" in libmutton.ini" + AnsiReset)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
config = append(config, keyConfig)
|
||||
}
|
||||
|
||||
return config
|
||||
|
||||
Reference in New Issue
Block a user