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
/path/to/my-package/file.go:43:3: error: Potential nil panic detected. Observed nil flow from source to dereference point:
- my-package/file.go:43:3: result 0 of `SpanFromContext()` lacking guarding; called `Finish()` via the assignment(s): - `tracer.SpanFromContext(ctx)` to `span` at my-package/file.go:42:3
but internally SpanFromContext, implemented here, cannot return nil:
@froodian: This error is getting reported after the merging of PR #157 . The logic in that PR includes the assumption that if the function has an ok-form, then the caller can safely access other returns only after checking ok to be true. Hence, NilAway fails fast if it finds that the ok return is suppressed. But clearly in this case the assumption is problematic, and we shouldn't fail fast. I'll investigate more and implement a solution to safeguard NilAway against such false positives. Thanks for reporting!
NilAway recently started complaining on some code it was happy with previously. The code looks like
and the error
but internally SpanFromContext, implemented here, cannot return nil:
The text was updated successfully, but these errors were encountered: