8000 handler in todo-list tutorial doesn't match the example code · Issue #858 · go-swagger/go-swagger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
handler in todo-list tutorial doesn't match the example code #858
Closed
@nathany

Description

@nathany

The tutorial at https://goswagger.io/tutorial/todo-list.html contains the following handler with an obvious race condition:

api.TodosDestroyOneHandler = todos.DestroyOneHandlerFunc(func(params todos.DestroyOneParams) middleware.Responder {
  delete(items, params.ID)
  return todos.NewDestroyOneNoContent()
})

The example code is quite different these days:
https://github.com/go-swagger/go-swagger/blob/master/examples/tutorials/todo-list/server-complete/restapi/configure_todo_list.go#L116

Should the tutorial be updated? And if so, should it match the example code exactly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0