From d3548e882d0fa6b072fb9a3179f44aaf88dfcf87 Mon Sep 17 00:00:00 2001 From: Finn Date: Tue, 18 Dec 2018 00:23:12 -0800 Subject: [PATCH] Fix b being unused --- testhelper.go | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/testhelper.go b/testhelper.go index 4bee0c2..0b5486e 100644 --- a/testhelper.go +++ b/testhelper.go @@ -1,13 +1,13 @@ -package main; +package main import ( - "net/http" - "io/ioutil" "database/sql" - _ "github.com/lib/pq" - "os" - "log" "fmt" + _ "github.com/lib/pq" + "io/ioutil" + "log" + "net/http" + "os" ) func crash(err error) { @@ -24,14 +24,15 @@ func main() { account := r.PostFormValue("account") var code string err := db.QueryRow("SELECT verification_code FROM pending_accounts WHERE number = $1", account).Scan(&code) - if(err != nil) { - fmt.Printf(w, "\n") + if err != nil { + fmt.Fprintf(w, "An error occured: %s\n", err) + } else { + fmt.Fprintf(w, "%s\n", code) } - fmt.Fprintf(w, "%s\n", code) }) http.HandleFunc("/v1/directory/reconcile", func(w http.ResponseWriter, r *http.Request) { - b, err := ioutil.ReadAll(r.Body) + _, err := ioutil.ReadAll(r.Body) defer r.Body.Close() crash(err) w.Header().Set("Content-Type", "application/json")