banks provides certain basic features for financial institution
documentation resides at ./docs folder.
Project is created with:
- Go
- Echo
- Postgres
- Docker
- Mockery
Note: The app will start with a seeder for customers.
$ docker-compose up -d
1. First get a bash shell in the container
$ docker-compose exec bank_go bash
2. Execute all test cases with coverage
$ go test -cover -v ./...
3. Execute test cases for a specific package [optional]
$ go test -cover -v ./internal/server/... -v
$ go test -cover -v ./internal/service/... -v
Project uses golangci-lint. It is a go linter aggregator that can enable up to 48 linters.
golanci-lint configuration is found in .golangci.yml file.
# binary installation for linux and Windows, binary will be $(go env GOPATH)/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.35.2
Check if the tool is correctly installed
golangci-lint --version
golangci-lint run
golangci-lint print out warning messages in command-line related to the enabled linters in order to fix them.
To format all files in the project based on the gofmt linter. Ref
gofmt -s -w -l .
To fix go import packages linting warnings based on goimport linter. Ref
goimports -local ./ -w .
Guide How you should group your package based on golang structure.
- Implement more coverage with Unit Test
- Implement intergration tests
- Implement functional tests