import { Appear, Image } from 'mdx-deck' import { SplitRight } from 'mdx-deck/layouts'
=== RUN TestOpenUmbrella
--- PASS: TestOpenUmbrella
PASS
OK
import { CodeSurferLayout, CodeSurferColumnLayout, Code, Step, } from "code-surfer";
-
Handler code is BIG and getting bigger
- Possibility redundancy code
- Difficult to manage branching of logic flow
- Difficult to mocking a function
- Cannot maintain code clarity
-
Clean code
- Make a slim handler
- Put logic to usecase/service layer
- Move database query to repository layer
├── handler
│ └── handler.go
├── delivery
│ ├── todo_http.go
│ └── todo_http_test.go
├── repository
│ ├── mysql_category.go
│ ├── mysql_category_test.go
│ ├── mysql_task.go
│ ├── mysql_task_test.go
│ ├── repository_test.go
│ └── util.go
├── service.go
├── service_test.go
└── usecase
├── todo.go
└── todo_test.go