For a full explanation of the code, please see the accompanying blog post.
Use direnv as below,
or manually set contents of .env in your terminal or editor.
direnv allowdocker-compose up -d
make db-initmake test- Initializes environment variables and stores them in a singleton
- Initialize with
config.Init() - Access with
config.Instance()
- Initializes a database instance and stores it in a singleton
- Initialize with
db.Init() - Access with
db.Instance()
- Provides helpers for testing
- Call
test.InitConfig()instead ofconfig.Init()fromTestMainfunctions
- Contain entities, DAOs and tests