gopkg

module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT

README

gopkg

Absa Go package library

Project Health

Absa Go package library

Absa library

env

Environment variable helper extending standard os.Getenv.

Overview

Package contains several functions which returns the typed env variable for the given key and falls back to the given defaultValue if not set.

Usage
noProxy := env.GetEnvAsStringOrFallback("NO_PROXY", "*.foo.bar.com")
 
runOnStart := env.GetEnvAsStringOrFallback("RUN_ON_START", true)
shell

Shell command runner

Overview

Package shell is used for running executables and returns command output for further processing. It is a synchronized wrapper around the standard Go command package, which allows you to define environment variables in a native way and returns the output as a return value.

Usage
cmd := shell.Command{
	Command: "sh",
	Args: []string{"-c", "terraform apply -auto-approve tfplan"},
	Env: map[string]string{"name":"test"},
}
o, _ = shell.Execute(cmd)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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