Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infra/dbの処理のラップを消す #460

Open
ras0q opened this issue Sep 13, 2023 · 0 comments
Open

infra/dbの処理のラップを消す #460

ras0q opened this issue Sep 13, 2023 · 0 comments

Comments

@ras0q
Copy link
Member

ras0q commented Sep 13, 2023

public methodの中身をprivate functionで小分けにしてる
DBのエラーをdefaultErrorHandlingでまとめたいためにこうしてる(?)が、#459 でこの課題は解決されたためラップする必要がないので可読性を上げるために消したい
gorm.DBを引数に取れなくなるのでそこは注意する必要がある

knoQ/infra/db/event.go

Lines 30 to 33 in 2c1f0c1

func (repo *GormRepository) CreateEvent(params WriteEventParams) (*Event, error) {
e, err := createEvent(repo.db, params)
return e, defaultErrorHandling(err)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant