From 8574f2487e3db9dd4670f449f484bc1336fb9a38 Mon Sep 17 00:00:00 2001 From: Farhan Alvi <52133344+farhansolodev@users.noreply.github.com> Date: Wed, 3 May 2023 12:42:13 +0400 Subject: [PATCH] Update part8.rst forgot to return errMsg here --- tutorial/part8.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorial/part8.rst b/tutorial/part8.rst index 4006c0d..c213d69 100644 --- a/tutorial/part8.rst +++ b/tutorial/part8.rst @@ -41,7 +41,7 @@ Open **/models/todo.go** and add a new method called **Validate** to your Todo s if uadmin.Count(&todo, "name = ? AND id <> ?", t.Name, t.ID) != 0 { errMsg["Name"] = "This todo name is already in the system" } - return + return errMsg } Notice that the receiver for Validate() is not a pointer but the struct type. Also notice that the return is a map where the key is the field name and the value is the error message.