From 7b8d7322d0c1ee4e081dee1b2b4b17a398ff2bc5 Mon Sep 17 00:00:00 2001 From: "Gustavo L de Mello (Guz)" Date: Fri, 22 Nov 2024 19:12:35 -0300 Subject: [PATCH] refactor(lib,commands,errors): update errors to conform with Go's standatds --- lib/command_message.go | 6 +++--- lib/command_user.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/command_message.go b/lib/command_message.go index a17748d..d51c76e 100644 --- a/lib/command_message.go +++ b/lib/command_message.go @@ -31,11 +31,11 @@ func (c *MessageCommand) ApplicationCommand() *discordgo.ApplicationCommand { func (c *MessageCommand) Validate() error { switch { case c.Name == "": - return errors.New("Required property \"Name\" is empty") + return errors.New("required field \"Name\" is empty") case c.Description == "": - return errors.New("Required property \"Description\" is empty") + return errors.New("required field \"Description\" is empty") case c.Handler == nil: - return errors.New("Required property \"Handler\" is empty") + return errors.New("required field \"Handler\" is empty") } return nil } diff --git a/lib/command_user.go b/lib/command_user.go index 52e638c..b5ab060 100644 --- a/lib/command_user.go +++ b/lib/command_user.go @@ -31,11 +31,11 @@ func (c *UserCommand) ApplicationCommand() *discordgo.ApplicationCommand { func (c *UserCommand) Validate() error { switch { case c.Name == "": - return errors.New("Required property \"Name\" is empty") + return errors.New("required field \"Name\" is empty") case c.Description == "": - return errors.New("Required property \"Description\" is empty") + return errors.New("required field \"Description\" is empty") case c.Handler == nil: - return errors.New("Required property \"Handler\" is empty") + return errors.New("required field \"Handler\" is empty") } return nil }