apply gofmt

This commit is contained in:
Soam Vasani
2016-09-01 16:32:32 -07:00
parent 2c872642f3
commit 8c56818e0a
8 changed files with 69 additions and 77 deletions
+7 -8
View File
@@ -1,31 +1,30 @@
package router
import (
"net/http"
"log"
"io/ioutil"
"log"
"net/http"
)
func testRequest(targetUrl string, expectedResponse string) {
resp, err := http.Get(targetUrl)
if (err != nil) {
if err != nil {
log.Panicf("failed to make get request: %v", err)
}
defer resp.Body.Close()
if (resp.StatusCode != 200) {
if resp.StatusCode != 200 {
log.Panicf("response status: %v", resp.StatusCode)
}
body, err := ioutil.ReadAll(resp.Body)
if (err != nil) {
if err != nil {
log.Panic("failed to read response")
}
bodyStr := string(body)
log.Printf("Server responded with %v", bodyStr)
if (bodyStr != expectedResponse) {
if bodyStr != expectedResponse {
log.Panic("Unexpected response")
}
}
}