Skip to content
/ env Public

Small library to load and parse environment variables

License

Notifications You must be signed in to change notification settings

csothen/env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

env

Small library to parse environment variables

Installation

go get -u github.com/csothen/env

Usage

import "github.com/csothen/env"

func main() {
    err := env.Load(".env")
    if err != nil {
        panic(err)
    }

    name := env.String("NAME", "Csothen")

    age := env.Int("AGE", 22)
    height := env.Int32("HEIGHT", 171)
    port := env.Int64("PORT", 8080)

    pi := env.Float32("PI", 3.14)
    basePrice := env.Float64("BASE_PRICE", 100.00)

    show := env.Bool("SHOW_PRICES", false)
}

Releases

No releases published

Packages

No packages published

Languages