I have this function:
var db *gorm.DB
func DeleteCategory(id uint) error {
var category Category
category.ID = id
result := db.Delete(&category)
fmt.Println("result.Error: ", result.Error)
return result.Error
}
This function should delete row in the database and it is, but when I call this function multiple time with the same id, I expect it to throw error message at the second call, but it always return nil:
result.Error: <nil>
*I'm using postgreSQL for the database