Loggest thy stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
220 B

  1. package envvars
  2. import (
  3. "os"
  4. "strconv"
  5. )
  6. func Int(key string) int {
  7. value := os.Getenv(key)
  8. if value == "" {
  9. return 0
  10. }
  11. intValue, err := strconv.Atoi(value)
  12. if err != nil {
  13. return 0
  14. }
  15. return intValue
  16. }