gets an http status code from err or returns -1
(err error)
| 1212 | |
| 1213 | // gets an http status code from err or returns -1 |
| 1214 | func getHTTPStatusCode(err error) int { |
| 1215 | var httpErr interface{ HTTPStatusCode() int } |
| 1216 | if errors.As(err, &httpErr) { |
| 1217 | return httpErr.HTTPStatusCode() |
| 1218 | } |
| 1219 | return -1 |
| 1220 | } |
| 1221 | |
| 1222 | // parseRetainUntilDate parses a retain until date from a string. |
| 1223 | // It accepts RFC 3339 format or duration strings like "365d", "1y", "6m". |
no outgoing calls
no test coverage detected
searching dependent graphs…