mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-15 04:33:54 +00:00
Return early from parseOptions
This commit is contained in:
parent
02e50c0126
commit
8d86f1ec6e
1 changed files with 11 additions and 8 deletions
|
@ -158,7 +158,11 @@ func init() {
|
|||
|
||||
func parseOptions(options map[string]string, in string) error {
|
||||
in = strings.Trim(in, " ")
|
||||
if in != "" {
|
||||
|
||||
if in == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, v := range strings.Split(in, ",") {
|
||||
keyVal := strings.Split(v, "=")
|
||||
key := strings.ToLower(strings.Trim(keyVal[0], " "))
|
||||
|
@ -167,7 +171,6 @@ func parseOptions(options map[string]string, in string) error {
|
|||
}
|
||||
options[key] = keyVal[1]
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue