Idiomatic Go type-erases error types into `error`, when there is even a known type in the first place.
Thus `From` is not a consideration, because the only `From` you need is
impl<'a, E> From<E> for Box<dyn Error + 'a> where E: Error + 'a,
That's clearly not true.
type MyError struct{} func (MyError) Error() string { return "MyError" } func main() { var err error = MyError{} fmt.Printf("%T\n", err) // Output: main.MyError }
Idiomatic Go type-erases error types into `error`, when there is even a known type in the first place.
Thus `From` is not a consideration, because the only `From` you need is
and that means you can just build that in and nothing else (and it's really already built-in by the implicit upcasting of values into interfaces).