Skip to content
/ go-env Public

Simple go lib for environment variables with default values.

License

Notifications You must be signed in to change notification settings

amonsat/go-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-env

Simple go lib for environment variables with default values.

Use

Functions:

  • GetBool()
  • GetString()
  • GetInt()
  • GetInt64()
  • GetFloat32()
  • GetFloat64()
  • GetUint()
  • GetUint64()
  • GetDuration()

Instalation

    go get github.com/amonsat/go-env

Basic Use

package main

import env "github.com/amonsat/go-env"

var (
    debug := env.GetBool("DEBUG", false)
    mongoAddr := env.GetString("MONGO_ADDR", "mongodb://127.0.0.1:27017")
)

func main() {
    println("Debug mode: ", debug)
    println("Mongo addr: ", mongoAddr)
}

About

Simple go lib for environment variables with default values.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages