env

package
v0.0.0-...-2ee2aa9 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package env contains a wrapper around the environment, making it easier to write code and tests that use environment variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	// contains filtered or unexported fields
}

Env represents the environment

func NewFromKVList

func NewFromKVList(env []string) *Env

NewFromKVList builds and returns an Env using a provided list of string in the form "key=value"

func NewFromOs

func NewFromOs() *Env

NewFromOs builds and returns an Env using os.Environ

func (*Env) Get

func (e *Env) Get(key string) string

Get returns the value of the given key, or en empty string if the key has no values set. Get is case-sensitive.

func (*Env) Has

func (e *Env) Has(key string) bool

Has returns whether the given key has a value set. Has is case-sensitive.

Jump to

Keyboard shortcuts

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