This repo is to demonstrate refactoring legacy Go project from MVC structure style to the proper Go's structure.
master
branch contains the legacy version- Refactoring has 5 steps. Each step contains commits that explain how I refactor Go structure
refactor-step1
branch is to moveuser
domain touser
packagerefactor-step2
branch is to moveproduct
domain toproduct
packagerefactor-step3
branch is to rename components to proper namerefactor-step4
branch is to remove all legacy structurerefactor-step5
branch is to introducecmd
andinternal
package
- Create directory
dist
at root project - On
master
branch to step 1-4, you can build withgo build -o dist/shopping-api .
- On
refactor-step5
branch, you can build withgo build -o dist/shopping-api ./cmd/shopping-api/