redact

package
v1.1.2 Latest Latest
Warning

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

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

Documentation

Overview

Package redact provides utilities to strip sensitive values from strings before they appear in output, logs, or error messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResetForTest added in v1.0.0

func ResetForTest()

ResetForTest resets the cached secrets so tests in other packages can verify redaction behavior after setting env vars with t.Setenv.

func String

func String(s string) string

String replaces any occurrence of a known sensitive environment variable value with "[REDACTED]". Returns the original string if no secrets are found. Secret values are cached on first call for performance.

Types

This section is empty.

Jump to

Keyboard shortcuts

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