Discover Packages
github.com/ory-am/common
env
package
Version:
v0.4.0
Opens a new window with list of versions in this module.
Published: Apr 13, 2017
License: Apache-2.0
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 33
Opens a new window with list of known importers.
README
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"
}
}
Expand ▾
Collapse ▴
Documentation
¶
A very handy library which adds defaults to os.GetEnv()
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.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.