Help us shape the future of Go! Take the 2026 Go Developer Survey

sensitive

package
v0.49.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package sensitive marks errors whose text can carry file contents or secret values, such as a parser quoting the line it failed on. The text still reaches the terminal; usage telemetry replaces it with "[redacted]".

Index

Constants

View Source
const FlagAnnotation = "volcano_sensitive"

FlagAnnotation marks a flag whose value usage telemetry never sends, even when its name is one telemetry would otherwise report as a resource name. Set it with cmd.Flags().SetAnnotation(name, FlagAnnotation, []string{"true"}).

Variables

This section is empty.

Functions

func Contains

func Contains(err error, get func(error) string) bool

Contains reports whether the first sensitive error in err's chain yields a non-empty value from get, for example an API error code inside it.

func Text

func Text(err error) string

Text returns the text of the first sensitive error in err's chain, or "" when there is none.

func Wrap

func Wrap(err error) error

Wrap marks err as sensitive. It returns nil for a nil err.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error wraps an error whose text must not leave the machine.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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