v1.6.0: make New() and Wrap() consider their string as PII-free (BREAKING CHANGE)
THIS IS A POSSIBLY BREAKING CHANGE. READ CAREFULLY
The errors.New(), errors.NewWithDepth(), errors.Wrap() and
errors.WrapWithDepth() now consider that their string argument do
not contain PII or unsafe data, and the string is now also included
in Sentry reports.
This is a breaking change if your code uses the included
Sentry reporting: in previous versions, only the format
argument to errors.Newf, errors.Wrapf etc. was considered to be
PII-free and reportable. With the new version, more strings
are considered PII-free and reportable.
This also means that care must be taken when using this errors
library as drop-in replacement for other errors libraries: callers
that use New() and Wrap() directly must be audited to ensure that
they indeed pass strings that are safe for reporting to Sentry.
This can be enforced e.g. via linters that assert that the argument is
a literal (constant) string. This is the approach taken e.g. in
CockroachDB.
The motivation for this is discussed here: cockroachdb/cockroach#49752
and cockroachdb/cockroach#49660 (comment)