env

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(varName string, params ...string) (string, error)

GetEnv takes the name of the environment variable as the first parameter. If the environment variable is found, the value is returned. If the environment variable is not found, the second parameter is used for a default value. If the second parameter is not set, an error is returned. You may choose to provide default value depending on your needs.

func GetEnvAsBool

func GetEnvAsBool(varName string, params ...bool) (bool, error)

GetEnvAsBool takes the name of the environment variable as the first parameter. If the environment variable is found and the value is of type boolean, the value is returned. If the environment variable is not found, the second parameter is used for a default value. If the second parameter is not set, an error is returned. You may choose to provide default value depending on your needs.

func GetEnvAsInt

func GetEnvAsInt(varName string, params ...int) (int, error)

GetEnvAsInt takes the name of the environment variable as the first parameter. If the environment variable is found and the value is of type integer, the value is returned. If the environment variable is not found, the second parameter is used for a default value. If the second parameter is not set, an error is returned. You may choose to provide default value depending on your needs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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