From 786b9adc2252a0e64e2619d240684f5ea1f244cc Mon Sep 17 00:00:00 2001 From: Alicia Date: Sat, 23 Feb 2019 16:42:39 +0000 Subject: [PATCH] d --- register.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/register.go b/register.go index 515bf70..cfba425 100644 --- a/register.go +++ b/register.go @@ -96,11 +96,8 @@ func registerSubmit(c *gin.Context) { errr := db.QueryRow("SELECT id FROM beta_keys WHERE key_md5 = ? AND allowed = 1", cmd5(c.PostForm("key"))) fmt.Printf("%v", errr) - for errr.Next() { - i++ - } - if i == 0 { - registerResp(c, errorMessage{T(c, "Invalid Beta Key.")}) + if err.Scan(new(int)) == sql.ErrNoRows { + registerResp(c, errorMessage{T(c, "key bad.")}) return }