I'm designing a monolith RESTful API that potentially sometime in the future may turn into microservices. I'm also trying following Uncle Bob's clean code as well. My question lies in structuring the Go code. Many times I see the following file structure for example:
|-- users
| --/ driver
| --/ entity
| --/ usescases
| --/ controller
|-- posts
| --/ driver
| --/ entity
| --/ usescases
| --/ controller
And the respective files under each file. This would allow me to more easily convert to microservices if the need by and uses separation of concerns. However I was looking at an example of implementing this in Go and they structured their file system like the following:
| --drivers
| --/ users
| --/ posts
| --entities
| --/ users
| --/ posts
| --usescases
| --/ users
| --/ posts
| --controllers
| --/ users
| --/ posts
In this discussion the creator claims that the first file structure is not idiomatic Go. I'm relatively new to Go but not Clean Code and wondering if this is really not good Go code? Should I be using the second file structure, even though it will make converting to microservices rather difficult and it doesn't really follow the separation of concerns principle? Thanks!