Deleting model - Sharykhin/go-modular GitHub Wiki

To delete an instance of model (row in database) first of all you have to get the model

todoModel := Todo.New()
todoModel.FindById(id)

Now we are able to call Delete method

if err := todoModel.Delete(); err != nil {
    return err
}

Current method will remove row from database and set your primary key as nil, but other data won't be touched

fmt.Println(todoModel.GetTitle())

Will show

Borrow a book 

It means that you can continue to work with model, even save it again.