Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tutorial/part8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down