Releases: Cloudment/utils-go
Releases · Cloudment/utils-go
v0.0.4 - Random Durations and OTP codes
- Added a feature to randomly generate random durations
utils.GenerateRandomDuration(1, 10, time.Second)
- Added a feature to generate OTP codes
GenerateOTP(6)
that are number based.
Added some direction for environment utilities.
v0.0.3 - Trailing slash for prefixes in envs
In the case of using structs for environment variables in a config, previously you had to define an _ in the tag, now it checks if it should add one or not.
v0.0.2 - Error handling and comments
- Added a few missing comments
- Fixed handling with time.ParseDuration with days, as days aren't always exactly 24 hours long, added a note into error message for better user understanding.
error loading environment variables: failed to parse value: time: unknown unit \"d\" in duration \"90d\"
to
error loading environment variables: failed to parse value: use '24h' instead of '1d' for 24 hours: time: unknown unit "d" in duration "1d"
First release
Initial release for env reading and basic utils.
- GORM search query
- Bind request to struct for http
- Read env file to a struct