Ugh
Peter Bourgon
7 years ago
110 | 110 | defer proxyServer.Close() |
111 | 111 | |
112 | 112 | resp, _ := http.Get(proxyServer.URL) |
113 | if want, have := http.StatusBadGateway, resp.StatusCode; want != have { | |
114 | t.Errorf("want %d, have %d", want, have) | |
113 | switch resp.StatusCode { | |
114 | case http.StatusBadGateway: // go1.7 and beyond | |
115 | break | |
116 | case http.StatusInternalServerError: // to go1.7 | |
117 | break | |
118 | default: | |
119 | t.Errorf("want %d or %d, have %d", http.StatusBadGateway, http.StatusInternalServerError, resp.StatusCode) | |
115 | 120 | } |
116 | 121 | } |