cockroachdb / cockroachdb/errors

Stop relying on `pkg/errors` to handle stack traces

Offen
#70 7 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
2.5k
Forks
74
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Today the stack trace formatting code delegates to `pkg/errors/stack.go`.

However, that code uses `runtime.FuncForPC` and emits file paths in the stack trace derived from the raw file name of the source file.

This method is outdated, as the on-disk file name of a given package's source may be different from the package path (due to go mod versioning, reproducible build sandboxes, etc).

The "modern" equivalent is `runtime.CallersFrame`, which populates `runtime.Frame` structs with package path-qualified function names.

We want to use that instead.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.