envvar

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromSlice

func FromSlice(env []string) map[string]string

FromSlice converts a slice of KEY=VALUE strings to a map of environment variables

func Merge

func Merge(base, priority map[string]string) map[string]string

Merge combines environment variables from two sources. Values from priority map override values from base map.

func MergeSlices

func MergeSlices(base, priority []string) []string

MergeSlices combines environment variables from two KEY=VALUE slice sources. Values from priority slice override values from base slice.

func Sanitize

func Sanitize(value string) string

Sanitize converts a string to a valid environment variable value format by replacing invalid characters with underscores

func ToSlice

func ToSlice(env map[string]string) []string

ToSlice converts a map of environment variables to a slice of KEY=VALUE strings

Types

This section is empty.

Jump to

Keyboard shortcuts

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