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 allow
docker-compose up -d
make db-init
make 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()
fromTestMain
functions
- Contain entities, DAOs and tests