env

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2017 License: Apache-2.0 Imports: 1 Imported by: 33

README

ory-libs/env

Adds defaults to os.GetEnv() and saves you 3 lines of code:

import "github.com/ory-am/common/env"

func main() {
  port := env.Getenv("PORT", "80")
}

versus

import "os"

func main() {
  port := os.Getenv("PORT")
  if port == "" {
    port = "80"
  }
}

Documentation

Overview

A very handy library which adds defaults to os.GetEnv()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Getenv

func Getenv(key string, fallback string) string

Getenv retrieves the value of the environment variable named by the key. It returns the value, which will return the fallback if the variable is not present.

Types

This section is empty.

Jump to

Keyboard shortcuts

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