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
For the below case, NilAway correctly tracks the implication of slicing an empty slice and does not report an error.
var x []int
_ = x[:0]
However, when the slicing index is a non-literal, like below, NilAway currently reports a false positive. Refine tracking of non-literal indices to understand such code patterns and avoid false positives. Update func (r *RootAssertionNode) isZeroSlicing(expr *ast.SliceExpr) bool { ... } method to add the support.
var x []int
_ = x[:min(len(x), 100)] // FP: unassigned variable `x` sliced into
The text was updated successfully, but these errors were encountered:
For the below case, NilAway correctly tracks the implication of slicing an empty slice and does not report an error.
However, when the slicing index is a non-literal, like below, NilAway currently reports a false positive. Refine tracking of non-literal indices to understand such code patterns and avoid false positives. Update
func (r *RootAssertionNode) isZeroSlicing(expr *ast.SliceExpr) bool { ... }
method to add the support.The text was updated successfully, but these errors were encountered: