Copy the env.example to .env and fill the required key
-
Go modules
go mode tidy -
Migration
-
Create new migration file
go run migration/create.go create_user_table -
Run migration up
migrate -database postgres://user:password@host/db_name -path schema up -
Run migration down (all)
migrate -database postgres://user:password@host/db_name -path schema down -
Run migration down (specific)
migrate -database postgres://user:password@host/db_name -path schema goto <version>
-
-
Run
go run main.go -
Mock repository for unit test
mockery --name=RepositoryInterfaceName