go-clean-arch icon indicating copy to clipboard operation
go-clean-arch copied to clipboard

Repository should be Unexported except by UseCase

Open xtianpu opened this issue 1 year ago • 0 comments

Hi! I think Repositories should be unexported by except the usecase, which can be achieved by putting underscore to function name of new repo instance and move the usecase and repo in one domain package for example:

article
├── usecase.go
├── repo.go

The approach above, will force clients to call service rather than calling the new repo instance.

xtianpu avatar May 17 '23 20:05 xtianpu