Skip to content

Instantly share code, notes, and snippets.

@suntong
Created November 1, 2015 22:09
Show Gist options
  • Save suntong/8c69f994a404738204ff to your computer and use it in GitHub Desktop.
Save suntong/8c69f994a404738204ff to your computer and use it in GitHub Desktop.
func getReqAddons(r Request) string {
ret := ""
if len(r.RequestPlugins.RequestPlugin) != 0 {
for _, v := range r.RequestPlugins.RequestPlugin {
ret += fmt.Sprintf(" R: (%s) %s\n", v.Name, minify(v.RuleParameters.Xml))
}
}
if len(r.ExtractionRules.ExtractionRule) != 0 {
for _, v := range r.ExtractionRules.ExtractionRule {
ret += fmt.Sprintf(" E: (%s: %s) %s\n", v.Name, v.VariableName, minify(v.RuleParameters.Xml))
}
}
if len(r.ValidationRules.ValidationRule) != 0 {
for _, v := range r.ValidationRules.ValidationRule {
ret += fmt.Sprintf(" V: (%s) %s\n", v.Name, minify(v.RuleParameters.Xml))
}
}
return ret + "\n"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment