bxcodec / go-clean-arch

Go (Golang) Clean Architecture based on Reading Uncle Bob's Clean Architecture
MIT License
9.03k stars 1.19k forks source link

Repository should be Unexported except by UseCase #77

Open xtianpu opened 1 year ago

xtianpu commented 1 year ago

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.