(id string, article *Article)
| 491 | } |
| 492 | |
| 493 | func dbUpdateArticle(id string, article *Article) (*Article, error) { |
| 494 | for i, a := range articles { |
| 495 | if a.ID == id { |
| 496 | articles[i] = article |
| 497 | return article, nil |
| 498 | } |
| 499 | } |
| 500 | return nil, errors.New("article not found.") |
| 501 | } |
| 502 | |
| 503 | func dbRemoveArticle(id string) (*Article, error) { |
| 504 | for i, a := range articles { |