i put the panic() in the wrong side of the if lol

This commit is contained in:
Finn Herzfeld 2019-01-08 14:15:04 -08:00
parent 8ad72af294
commit f3f9142f0a

View file

@ -26,10 +26,9 @@ func main() {
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)
log.Printf("Looking for verification code for %s", account) log.Printf("Looking for verification code for %s", account)
if err != nil { if err != nil {
fmt.Fprintf(w, "An error occured: %s\n", err) panic(err)
} else { } else {
fmt.Fprintf(w, "%s\n", code) fmt.Fprintf(w, "%s\n", code)
panic(err)
} }
}) })