envparse

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package envparse provides simple parsers for KEY=VALUE-style CLI inputs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSensitiveKey

func IsSensitiveKey(key string) bool

IsSensitiveKey reports whether key looks like it carries a secret value. Matching is case-insensitive substring against a fixed marker list.

func KeyValuePairs

func KeyValuePairs(raw string) map[string]string

KeyValuePairs parses a comma-separated KEY1=VALUE1,KEY2=VALUE2 string into a map. Empty input returns nil. Pairs without '=' are silently skipped. Whitespace around keys and values is trimmed.

func RedactForLog

func RedactForLog(env []string) []string

RedactForLog returns a copy of env entries (each in "KEY=VALUE" form, the same shape exec.Cmd.Env uses) where values for sensitive keys are replaced with the literal "***". Keys remain visible so operators can confirm which vars are passed without exposing the values. Entries without '=' pass through unchanged. The input slice is not mutated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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