support for equals in yaml-style lines

This commit is contained in:
Alex Quick
2017-05-20 15:06:01 -04:00
parent 84bf91f40e
commit 6f30f0c011
2 changed files with 10 additions and 4 deletions

View File

@ -198,11 +198,11 @@ func parseLine(line string) (key string, value string, err error) {
line = strings.Join(segmentsToKeep, "#")
}
// now split key from value
firstEquals := strings.Index(line, "=")
firstColon := strings.Index(line, ":")
splitString := strings.SplitN(line, "=", 2)
if len(splitString) != 2 {
// try yaml mode!
if firstColon != -1 && (firstColon < firstEquals || firstEquals == -1) {
//this is a yaml-style line
splitString = strings.SplitN(line, ":", 2)
}