MCPcopy
hub / github.com/go-chi/chi / dbRemoveArticle

Function dbRemoveArticle

_examples/rest/main.go:503–511  ·  view source on GitHub ↗
(id string)

Source from the content-addressed store, hash-verified

501}
502
503func dbRemoveArticle(id string) (*Article, error) {
504 for i, a := range articles {
505 if a.ID == id {
506 articles = append((articles)[:i], (articles)[i+1:]...)
507 return a, nil
508 }
509 }
510 return nil, errors.New("article not found.")
511}
512
513func dbGetUser(id int64) (*User, error) {
514 for _, u := range users {

Callers 1

DeleteArticleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected