Skip to content
l-vitalyPublic

About

Library for loading settings from environment variables

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

Go Env

Example

See

Generate from env file

Install:

go get -u github.com/l-vitaly/goenv/cmd/envgen

To generate a config based on the environment variable file, run the following command:

envgen <env_file> <prefix>

  • env_file - environment variable file
  • prefix - this value will be removed from the field names of the structure and constants

You can also group the fields in the structure by separating them with __ characters. For example, if the name of the environment variable is DB__CONN_SRT, then the result will be like this:

type Config {
  Db {
    ConnSrt string
  }
}

About

Library for loading settings from environment variables

Topics

Resources

Stars

6 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages