The new errors.AsType uses Go's generics rather than reflection, so it is faster, easier to use, and gives compile-time rather than runtime errors. It seems likely that we can use it as a drop-in replacement everywhere, although it may require sweeping changes across our test code.
Read more: https://antonz.org/go-1-26/#errors-astype, https://go.dev/issue/51945