Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: append all slice data when range for it #111

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alingse
Copy link

@alingse alingse commented Jul 3, 2024

TLDR: FIx a bug

I am writing a linter called sundrylint to address some real-world bugs that I discovered during my work.

When we range over a slice and call the append function within the loop body, we are not appending all elements, but only the ones that we specifically iterate over during the range operation.

for _, n := range ns {
   rs = append(rs, n)       # this is mostly wanted
   rs = append(rs, ns...)   # this is wrong
}

I read the code in here and I think it was just want to append the not IsCollinear ip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant