Improve error propagation (#1975)

This commit is contained in:
John Kerl 2026-02-16 16:48:41 -05:00 committed by GitHub
parent 1e762d7c4c
commit e1346691da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
71 changed files with 1252 additions and 911 deletions

View file

@ -7,8 +7,10 @@ import (
"runtime"
)
// InternalCodingErrorIf is a lookalike for C's __FILE__ and __LINE__ printing,
// with exit 1 if the condition is true.
// InternalCodingErrorIf reports an internal bug and exits. Use only for
// "should never happen" conditions (assertions), not for user or I/O errors.
// This is intentionally an exit helper: these indicate programmer error,
// and the codebase prefers returning error for recoverable failures.
func InternalCodingErrorIf(condition bool) {
if !condition {
return