-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(refac): Update variable regular expression to capture options #1
Conversation
Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
} | ||
return option | ||
} | ||
func processOptionString(exp string) (opts Options) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function does not work unfortunately. do you want me to fix it? (see private chat)
exp = strings.Trim(exp, ";") | ||
i, j := 0, 0 | ||
for { | ||
j = strings.Index(exp, exp[i:]) + 1 | ||
if i >= j { | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exp = strings.Trim(exp, ";") | |
i, j := 0, 0 | |
for { | |
j = strings.Index(exp, exp[i:]) + 1 | |
if i >= j { | |
break | |
func processOptionString(expression string) (opts Options) { | |
for _, flagToken := range strings.Split(expression, ";") { | |
flagValueTokens := strings.Split(flagToken, "=") | |
if len(flagValueTokens) < 2 { | |
continue | |
} | |
if flagValueTokens[0] == encodingFlag { | |
switch flagValueTokens[1] { | |
case urlEncodingFlag: | |
opts.Encoding = EncodingURL | |
} | |
} | |
} | |
return | |
} |
@alfrunes I moved to mendersoftware#235 fixed and included your PR. |
went with mendersoftware#235 |
No description provided.