Skip to content
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

alfrunes
Copy link

@alfrunes alfrunes commented Sep 7, 2022

No description provided.

Signed-off-by: Alf-Rune Siqveland <alf.rune@northern.tech>
}
return option
}
func processOptionString(exp string) (opts Options) {
Copy link
Owner

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)

Comment on lines +78 to +83
exp = strings.Trim(exp, ";")
i, j := 0, 0
for {
j = strings.Index(exp, exp[i:]) + 1
if i >= j {
break
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
}

@merlin-northern
Copy link
Owner

@alfrunes I moved to mendersoftware#235 fixed and included your PR.

@merlin-northern
Copy link
Owner

went with mendersoftware#235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants