Break Change: use yml, which is easier to parse, as the config format

This commit is contained in:
Dreamacro
2018-10-02 15:26:36 +08:00
parent 16c9445459
commit 5c7fa6b18b
12 changed files with 222 additions and 186 deletions

View File

@ -27,20 +27,3 @@ func or(pointers ...*int) *int {
}
return pointers[len(pointers)-1]
}
func parseOptions(startIdx int, params ...string) map[string]string {
mapping := make(map[string]string)
if len(params) <= startIdx {
return mapping
}
for _, option := range params[startIdx:] {
pair := strings.SplitN(option, "=", 2)
if len(pair) != 2 {
continue
}
mapping[strings.Trim(pair[0], " ")] = strings.Trim(pair[1], " ")
}
return mapping
}