Developer’s Guide

Adding new packages

Almighty uses Glide for package management. To install a new package, you can follow these steps. The <PACKAGE_PATH> should be replaced with the actual package path of the package. e.g.,

glide get <PACKAGE_PATH>
git add glide.yaml glide.lock
git commit -m "<message>"

If the glide get commands prompts for versions range, select the appropriate option. And most of the time, you can select M (minor) as it will ensure non-breaking changes are not going to be retrieved (Ref.


How to see the SQL query used by Gorm?

Add Debug() function call before Save(), Create() etc.

Two examples from Almighty code:

if err := tx.Debug().Create(&tq).Error; err != nil {
if err := tx.Debug().Save(&newTq).Error; err != nil {
This debug function call should not be committed and pushed to upstream.