env

package
Version: v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package for processing environment variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultEnvVariables

func DefaultEnvVariables() map[string]string

DefaultEnvVariables returns a default environment, with $PATH and $TERM set.

func Join

func Join(base map[string]string, override map[string]string) map[string]string

Join joins the two environment maps with override overriding base.

func ParseFile

func ParseFile(path string) (_ map[string]string, err error)

ParseFile parses the specified path for environment variables and returns them as a map.

func ParseSlice

func ParseSlice(s []string) (map[string]string, error)

ParseSlice parses the specified slice and transforms it into an environment map.

func Slice

func Slice(m map[string]string) []string

Slice transforms the specified map of environment variables into a slice. If a value is non-empty, the key and value are joined with '='.

Types

This section is empty.

Jump to

Keyboard shortcuts

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