Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 702 Bytes

README.md

File metadata and controls

31 lines (21 loc) · 702 Bytes

Configurations Loading using Viper and PFlag

An example of implementing configurations in an application using the viper and pflag packages.

  • CLI arguments (top precedence)
  • environment variables
  • configuration file
  • default values

The pflag package can be configured to allow POSIX/GNU style -- flags or the short form flags -.

Setup

<<<<<<< Updated upstream

  1. Build the program.

    $ make
  2. Run the program

    $ CYBER_DIRECTORY=env bin/viper --postgres-url=arg
    Dump of config: {true 5000 arg env default}

Reference and Credits