Skip to content

gopher-lib/config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

config Eloquent configuration for Golang apps.

Go Reference

Features:

  • Substitutes $VARIABLE and ${VARIABLE} with variables found in a shell environment.
  • Syntaxes for setting up default values and specifying mandatory variables:
    • ${VARIABLE:-default} evaluates to default if VARIABLE is unset or empty in the environment.
    • ${VARIABLE-default} evaluates to default only if VARIABLE is unset in the environment.
    • ${VARIABLE:?err} panics with an error message containing err if VARIABLE is unset or empty in the environment.
    • ${VARIABLE?err} panics with an error message containing err if VARIABLE is unset in the environment.

Examples: