Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 authored Sep 19, 2018
1 parent 5c1feba commit 7f73d65
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type config struct {
IsProduction bool `env:"PRODUCTION"`
Hosts []string `env:"HOSTS" envSeparator:":"`
Duration time.Duration `env:"DURATION"`
TempFolder string `env:"TEMP_FOLDER" envDefault:"${HOME}/tmp" envExpand:"True"`
TempFolder string `env:"TEMP_FOLDER" envDefault:"${HOME}/tmp" envExpand:"true"`
}

func main() {
Expand Down Expand Up @@ -84,10 +84,8 @@ and `0` for `int`s.

By default, slice types will split the environment value on `,`; you can change this behavior by setting the `envSeparator` tag.


If you set the `envExpand` tag, ${var} or $var in the string will be replaced according to the values of the current environment variables.


If you set the `envExpand` tag, environment variables (either in `${var}` or `$var` format)
in the string will be replaced according with the actual value of the variable.

## Custom Parser Funcs

Expand Down

0 comments on commit 7f73d65

Please sign in to comment.