Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 456 Bytes

README.md

File metadata and controls

17 lines (12 loc) · 456 Bytes

envparse

Inspried by the idea of Store config in the environment from The Twelve-Factor App. The envparse lib aims to make reading environment varaibles easier.

Usage:

func main() {
    parser := envparse.New()

    parser.Add(&envparse.Param{Name: "DB_URL", Required: true})
    parser.Parse() // panic if DB_URL is not set

    dbURL := parser.GetString("DB_URL") // retive a trimmed value

    // ...
}