Add optional key-values that will be outputted to JSON in config

This commit is contained in:
kota kanbe
2016-07-01 21:05:38 +09:00
parent d046608426
commit c285f9f587
8 changed files with 159 additions and 3 deletions

View File

@@ -118,6 +118,20 @@ func (c TOMLLoader) Load(pathToToml, keyPass, sudoPass string) (err error) {
s.Containers = d.Containers
}
s.Optional = v.Optional
for _, dkv := range d.Optional {
found := false
for _, kv := range s.Optional {
if dkv[0] == kv[0] {
found = true
break
}
}
if !found {
s.Optional = append(s.Optional, dkv)
}
}
s.LogMsgAnsiColor = Colors[i%len(Colors)]
i++