(code int)
| 43 | } |
| 44 | |
| 45 | func Check2xxCode(code int) error { |
| 46 | if code < 200 || code > 299 { |
| 47 | return errors.New(fmt.Sprintf("non-2xx code: %d", code)) |
| 48 | } |
| 49 | return nil |
| 50 | } |
| 51 | |
| 52 | func WaitForServer(url string, timeout time.Duration) error { |
| 53 | ctx, cancelFunc := context.WithTimeout(context.Background(), timeout) |