I start to refactor this project to advanced learning.
└── project/
├── cmd/
│ └── cli/
│ └── main.go
├── internal/
│ ├── config/
│ │ └── config.go
│ ├── database/
│ │ ├── postgres/
│ │ ├── sqlrepo/
│ │ └── ..
│ ├── helper/
│ │ └── ..
│ ├── models/
│ │ ├── user.go
│ │ ├── product.go
│ │ └── ..
│ ├── repository/
│ │ │ ├── user.go
│ │ │ ├── product.go
│ │ │ └── ..
│ ├── services/
│ │ ├── user.go
│ │ ├── product.go
│ │ └── ..
│ └── util/
│ └── menu
│ ├── user.go
│ ├── product.go
│ └── ..
├── tests/
├── .env
├── .env.example
├── .gitignore
├── go.mod
├── go.sum
└── README.md
/cmdMain applications for this project./internalContains application core code that is not intended to be used by external packages./configManage application configurations (e.g., databases, servers)./databaseContains interactions with the database./helperCross-cutting concerns and common utilities./modelsDefines data structures./repositoryManage interactions with databases or other data sources./servicesImplementing business logic./utilsContains general utility functions.
/testsContains unit tests and integration tests. The test is designed to check the behavior method, not the actual content.
go get github.com/spf13/vipergo get github.com/jmoiron/sqlxgo get github.com/lib/pqgo get github.com/olekukonko/tablewritergo get github.com/stretchr/testify/mockgo get golang.org/x/termgo get golang.org/x/crypto/bcrypt
