env-vars-example

command module
v0.0.0-...-39dbf0d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 4 Imported by: 0

README

Environment Variables Example

Build Status

Really tiny and simple example about using both envconfig and godotenv as a prerequisite for a 12 factor application.

Usage

Without indicating any environment variable it uses the default values:

$ ./env-vars-example
root:@localhost:3306/dbname

but if you set the environment variables, those take preference:

$ DSN_USERNAME=mario DSN_HOST=fancy.com ./env-vars-example
mario:@fancy.com:3306/dbname

Documentation

Overview

Simple example for providing default environment variables via an env file and wrapping those into a struct with the possibility to override them if needed

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL