proposal: Go 2: text/template: return errors from HTMLEscape and JSEscape #29003
That's fine when the destination
It is possible for the caller to detect those errors by wrapping the
These functions should return errors, and leave the decision about whether those errors are safe to ignore up to the caller.
This change would be call-site compatible (leaving the vast majority of callers unchanged), but would break programs that pass or assign
As an alternative, we could add variants of those functions that do return errors; however, separate variants would mask missing error checks from analysis tools. I believe it would be better to simply change the signature in a Go 2 cleanup.