Skip to content

Commit

Permalink
Update invoker.go
Browse files Browse the repository at this point in the history
In addition to #34.
  • Loading branch information
pavelpatrin authored Jul 1, 2024
1 parent 59bc3d5 commit a46a635
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ func (i *invoker) Invoke(fn any) (InvokeResult, error) {
if index == len(fnOutArgs)-1 {
// And type of the value is the error.
if fnOut.Type().Implements(errorType) {
// Use the value as an error. Perform safe type conversion to avoid panics.
// Use the value as an error.
// Ignore failed cast of nil error.
result.err, _ = fnOut.Interface().(error)
}
}
Expand Down

0 comments on commit a46a635

Please sign in to comment.