- Setting up PostgreSQL for dev environment
docker-compose -f docker-compose.dev.yaml up -d
- Run Makefile for cloning service proto and symlink
make apis
- Run migration for database
git clone https://github.com/hu-tao-supremacy/migrations/
cd migrations
yarn
make migrate
- Prepare Go's env
source dev-env
- Code
code .
- Run
go run ./cmd/!(*_test).go
- Run go build command
go build -o main ./cmd/*.go
- Execute binary file
./main
- Coverage
go test -cover $(go list ./... | grep -v hts) -coverprofile=coverage.out
- View test coverage in terminal
go tool cover -func=coverage.out
- View test coverage in html format
go tool cover -html=coverage.out -o coverage.html
- make sure you have setup Docker Desktop and connected to WSL2
- for connecting with WSL2's GRPC port from windows
- run
wsl hostname -I
on windows cmd to find WSL2 ip address
- run
psql -U username -h localhost -p 5432 dbname