From e9c29afd670fb8e51033f60c4e0ebcb7fa69ee66 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 1 Mar 2024 09:40:12 -0600 Subject: [PATCH] register return error instead of bool --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index ce4838b..074b224 100644 --- a/main.go +++ b/main.go @@ -94,7 +94,7 @@ func Register(username, email, ip string) error { _, err = c.db.Query(fmt.Sprintf("insert into %s_users (username, password) VALUES (?,?)", c.TablePrefix), username, crypt) if err != nil { log.Printf("scsusers.Register: insert failed: %s\n", err.Error()) - return fmt.Errorf("Failed to insert user") + return fmt.Errorf("failed to insert user") } if SendRegistrationEmail(email, username, string(pass)) { @@ -107,7 +107,7 @@ func Register(username, email, ip string) error { if err != nil { log.Printf("scsusers.Register: Failed to delete new user %s: %s\n", username, err.Error()) } - return fmt.Errorf("Failed to send registration email") + return fmt.Errorf("failed to send registration email") } func NewUser() *UserData {