Return the statusCode comparison clause from the response name.
(statusCodeVar, responseName string)
| 303 | |
| 304 | // Return the statusCode comparison clause from the response name. |
| 305 | func getConditionOfResponseName(statusCodeVar, responseName string) string { |
| 306 | switch responseName { |
| 307 | case "default": |
| 308 | return "true" |
| 309 | case "1XX", "2XX", "3XX", "4XX", "5XX": |
| 310 | return fmt.Sprintf("%s / 100 == %s", statusCodeVar, responseName[:1]) |
| 311 | default: |
| 312 | return fmt.Sprintf("%s == %s", statusCodeVar, responseName) |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | // This outputs a string array |
| 317 | func toStringArray(sarr []string) string { |
no outgoing calls
no test coverage detected
searching dependent graphs…