How to avoid circular dependency in golang projects

Vikas Avnish
Dec 10, 2023

--

Sometimes we encounter circular dependency in your project. Reason for this dependency hell is unclear structure. To avoid circular dependency , follow a linear structure.

Steps to avoid the circular dependency
1.A function should do only one thing and do it well
2. Architecture based clarity.

Some hint about project structure:

  1. models : The database layer to get and set data from database.

--

--

Responses (1)