|
|
|
|
|
by Mawr
333 days ago
|
|
The difference between just "?" and "?" + <good error message> is much greater than the difference between "if err != nil { return err }" and "if err != nil { return fmt.Errorf("<good error message") }". Part of it is the syntactical easiness of "?", how can any other solution compete with the ease of typing a single character? But mostly, it's that "fmt.Errorf" is built-in and widely used, as opposed to whatever library you need to go out of your way to choose to be able to easily annotate errors in Rust. |
|