예제 #1
0
파일: server.go 프로젝트: karolgorecki/todo
// deleteTasks removes all tasks
func deleteTasks(rw http.ResponseWriter, req *http.Request, _ httprouter.Params) {
	task.DeleteAll()
	rw.WriteHeader(http.StatusNoContent)
}
예제 #2
0
func TestDeleteAllTasks(t *testing.T) {
	task.DeleteAll()
	if len(testdb.Tsks) != 0 {
		t.Error("Tasks were not deleted")
	}
}