On Friday, 18 October 2013, Florian Weimer wrote:
>
>
> It's more common to simply return the object.
>

Only in toy programs, or where there is no meaningful additional context.


> Due to some obscure feature of Go's type system, error values have to
> be interfaces and cannot be struct types


Struct types can be put in interfaces and extracted using type assertions,
such as the error returned by os.Open. However the general case is to use
textual errors.


> , so I have not seen anyone
> trying to updating an existing error.  Wrapping might happen, but
> there is no general chaining mechanism like there is in Java.
>

The default is fmt.Errorf for textual errors.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to