Fix b being unused

This commit is contained in:
Finn 2018-12-18 00:23:12 -08:00
parent 7822e7154f
commit d3548e882d

View file

@ -1,13 +1,13 @@
package main; package main
import ( import (
"net/http"
"io/ioutil"
"database/sql" "database/sql"
_ "github.com/lib/pq"
"os"
"log"
"fmt" "fmt"
_ "github.com/lib/pq"
"io/ioutil"
"log"
"net/http"
"os"
) )
func crash(err error) { func crash(err error) {
@ -24,14 +24,15 @@ func main() {
account := r.PostFormValue("account") account := r.PostFormValue("account")
var code string var code string
err := db.QueryRow("SELECT verification_code FROM pending_accounts WHERE number = $1", account).Scan(&code) err := db.QueryRow("SELECT verification_code FROM pending_accounts WHERE number = $1", account).Scan(&code)
if(err != nil) { if err != nil {
fmt.Printf(w, "\n") 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) { 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() defer r.Body.Close()
crash(err) crash(err)
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")