Created
November 1, 2015 22:12
-
-
Save suntong/e4cc51fb6e6c3eefe497 to your computer and use it in GitHub Desktop.
By Dan Kortschak, http://play.golang.org/p/8Jq_dPuwNF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getReqAddons(r Request) string { | |
var buf bytes.Buffer | |
if len(r.RequestPlugins.RequestPlugin) != 0 { | |
for _, v := range r.RequestPlugins.RequestPlugin { | |
fmt.Fprintf(&buf, " R: (%s) %s\n", v.Name, | |
minify(v.RuleParameters.Xml)) | |
} | |
} | |
if len(r.ExtractionRules.ExtractionRule) != 0 { | |
for _, v := range r.ExtractionRules.ExtractionRule { | |
fmt.Fprintf(&buf, " 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 { | |
fmt.Fprintf(&buf, " V: (%s) %s\n", v.Name, | |
minify(v.RuleParameters.Xml)) | |
} | |
} | |
buf.WriteByte('\n') | |
return buf.String() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment