Code extracts the status code from the first status
()
| 84 | |
| 85 | // Code extracts the status code from the first status |
| 86 | func (p *Prop) Code() int { |
| 87 | if len(p.Status) == 0 { |
| 88 | return -1 |
| 89 | } |
| 90 | match := parseStatus.FindStringSubmatch(p.Status[0]) |
| 91 | if len(match) < 2 { |
| 92 | return 0 |
| 93 | } |
| 94 | code, err := strconv.Atoi(match[1]) |
| 95 | if err != nil { |
| 96 | return 0 |
| 97 | } |
| 98 | return code |
| 99 | } |
| 100 | |
| 101 | // StatusOK examines the Status and returns an OK flag |
| 102 | func (p *Prop) StatusOK() bool { |
no outgoing calls
no test coverage detected