What are best practices on errors with field data, passing errors up, wrapping errors, and checking error values?
<p>I understand that <code>error</code> is an interface, and that in theory there are lots of choices for what to satisfy that interface. However, in practice, what tends to be chosen?</p> <p>When is <code>errors.New</code> or <code>fmt.Errorf</code> preferred? Should those be the default, in t...阅读全文