env

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package for processing environment variables.

Index

Constants

This section is empty.

Variables

View Source
var DefaultEnvVariables = map[string]string{
	"PATH": "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
	"TERM": "xterm",
}

DefaultEnvVariables sets $PATH and $TERM.

Functions

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