Documentation ¶
Overview ¶
Package env provides functionality to interact with the environment variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment interface { // Getenv returns the value of the environment variable named by the key. // It returns an empty string if the key does not exist. Getenv(key string) string }
Environment is an interface that defines a method for getting environment variables.
type RealEnvironment ¶
type RealEnvironment struct{}
RealEnvironment is a struct that implements the Environment interface.
func (RealEnvironment) Getenv ¶
func (e RealEnvironment) Getenv(key string) string
Getenv is a method on the RealEnvironment struct that retrieves the value of the environment variable named by the key. It uses the os package's Getenv function to do this. It returns an empty string if the key does not exist.
Click to show internal directories.
Click to hide internal directories.