env

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 1 Imported by: 0

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.

Jump to

Keyboard shortcuts

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