envutil

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvBool

func GetEnvBool(envKey string, defaultValue bool) bool

GetEnvBool returns the boolean value of the environment variable specified by envKey. If the environment variable is not set or is empty, it returns the defaultValue. Truthy values (case-insensitive): "1", "true", "yes", "on" Falsy values (case-insensitive): "0", "false", "no", "off" Any other value returns the defaultValue.

func GetEnvInt

func GetEnvInt(envKey string, defaultValue int) int

GetEnvInt returns the integer value of the environment variable specified by envKey. If the environment variable is not set, is empty, cannot be parsed as an integer, or is not positive (> 0), it returns the defaultValue. This function validates that the value is a positive integer.

func GetEnvString

func GetEnvString(envKey, defaultValue string) string

GetEnvString returns the value of the environment variable specified by envKey. If the environment variable is not set or is empty, it returns the defaultValue.

Types

This section is empty.

Jump to

Keyboard shortcuts

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