redact

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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