You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This allows constructors to fail with an error. So you can now use the
following as a constructor with `Graph.Register`.
func NewMyResult(...) (*MyResult, error) {
// ..
}
The error is wrapped for every layer of resolve so that you get,
unable to resolve *Foo:
unable to resolve *Bar:
unable to resolve *MyResult:
root cause
Resolves#283
Right now it's required that constructors return one and only one value: a pointer.
@dmcaulay pointed out it might be useful to return
*ptr, error
, in case constructors fail to initialize for one reason or another.The text was updated successfully, but these errors were encountered: