redactutils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 1 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Redact

func Redact(s string) string

Redact fully hides s, revealing only that it is redacted and its length, e.g. "[REDACTED:12]" (or "[REDACTED]" when empty).

func RedactWithPrefix

func RedactWithPrefix(s string) string

RedactWithPrefix redacts s but keeps a short readable prefix (5 chars), useful for correlating values without exposing them.

func RedactWithPrefixSized

func RedactWithPrefixSized(s string, maxLen int) string

RedactWithPrefixSized is RedactWithPrefix with an explicit prefix length; values no longer than maxLen are fully redacted via Redact.

func Trim

func Trim(s string) string

Trim shortens s for logging using the default limit (10 chars), keeping a prefix and the original length. Values are not hidden; use Redact for secrets.

func TrimSized

func TrimSized(s string, maxLen int) string

TrimSized is Trim with an explicit prefix length: it returns "[s]" when s fits in maxLen, otherwise "[prefix...:len]".

Types

This section is empty.

Jump to

Keyboard shortcuts

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