-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Hi,
Today, I read revel's src, and find a place in goconfig that I can't understand. Can you help me?
in goconfig/config/read.go Line93, why getting the index of "=:" twice, I think inner one is same as the outer one.
// Other alternatives
default:
i := strings.IndexAny(l, "=:")
switch {
// Option and value
case i > 0:
i := strings.IndexAny(l, "=:")
option = strings.TrimSpace(l[0:i])
value := strings.TrimSpace(stripComments(l[i+1:]))
self.AddOption(section, option, value)
// Continuation of multi-line value
case section != "" && option != "":
prev, _ := self.RawString(section, option)
value := strings.TrimSpace(stripComments(l))
self.AddOption(section, option, prev+"\n"+value)
default:
return errors.New("could not parse line: " + l)
}
}
Metadata
Metadata
Assignees
Labels
No labels