env

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 1 Imported by: ? modules, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env interface {
	Getenv(key string) string
	Setenv(key, value string) error
	LookupEnv(key string) (string, bool)
	Environ() []string
}

Env interface allows us to substitute the system environment with other targets. See os package for definition of functions.

type EnvMap

type EnvMap struct {
	Vars map[string]string
}

EnvMap gets vars from a map

func (*EnvMap) Environ

func (s *EnvMap) Environ() []string

func (*EnvMap) Getenv

func (s *EnvMap) Getenv(key string) string

func (*EnvMap) LookupEnv

func (s *EnvMap) LookupEnv(key string) (string, bool)

func (*EnvMap) Setenv

func (s *EnvMap) Setenv(key, value string) error

type EnvOS

type EnvOS struct{}

EnvOS gets vars from system

func (*EnvOS) Environ

func (s *EnvOS) Environ() []string

func (*EnvOS) Getenv

func (s *EnvOS) Getenv(key string) string

func (*EnvOS) LookupEnv

func (s *EnvOS) LookupEnv(key string) (string, bool)

func (*EnvOS) Setenv

func (s *EnvOS) Setenv(key, value string) error

Jump to

Keyboard shortcuts

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