func (r *PostRepository) Update(post *core.Post) error { _, err := dat.Update(r, post.ID(), post) if err != nil { log.Printf("Error updating post: %s", err) } return err }
func (r *PostRepository) Save(post *core.Post) error { result, err := dat.Create(r, post) if err != nil { log.Printf("Error creating new post: %s", err) return err } post.SetID(result.GeneratedKeys[0]) return nil }