These operations would help but they're not unique to errors, even though they most often arise in that context.
Since this proposal relies on some form of generics to implement As
, why not make the interface and both operations generic so we can Is
or As
a wrapped io.Reader
just as easily?
I think one of us is misunderstanding the other; my point is that
As(wrappedReader, io.ReaderAt)
doesn't seem to be useful under any circumstance I can see, so this doesn't appear to be an argument in favor of making the operation generic.When do you see an unwrapping
As
function as being useful for non-errors?