From 6b5db99936db5c128fd026cee97705a8f307e2f4 Mon Sep 17 00:00:00 2001 From: Lukas Braun <lukas.braun@fau.de> Date: Wed, 1 Feb 2017 00:13:51 +0100 Subject: [PATCH] remove unused named return parameters in check_offer --- goatherd.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/goatherd.go b/goatherd.go index e702293..c1ba52d 100644 --- a/goatherd.go +++ b/goatherd.go @@ -173,12 +173,14 @@ func transaction_failed(err error) bool { // Retrieve secret and count for given username and try to find a match within // the lookahead range. Update count in DB if match is found. All within a // transaction, retrying if it fails. -func check_offer(db *sql.DB, remote net.Addr, name string, offer string) (ok bool, err error) { +func check_offer(db *sql.DB, remote string, name string, offer string) (bool, error) { for { debugf("[%v] begin transaction", remote) tx, err := db.Begin() err_panic(err) + ok := false + debugf("[%v] looking up data for %v", remote, name) hotp, err := get_otp(tx, name) if transaction_failed(err) { @@ -207,8 +209,6 @@ func check_offer(db *sql.DB, remote net.Addr, name string, offer string) (ok boo } } - ok = false - commit: debugf("[%v] commiting", remote) err = tx.Commit() -- GitLab