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

slices: don't modify input slices in test #30677

Merged
merged 1 commit into from
Feb 17, 2024

Commits on Feb 17, 2024

  1. slices: don't modify input slices in test

    In Go 1.22, slices.CompactFunc will clear the slice elements that got
    discarded. This makes TestSortedUniqueFunc fail if it is run in
    succession to other tests modifying the input slice.
    
    Avoid this case by not modifying the input slice in the test case but
    make a copy for the sake of the test.
    
    Signed-off-by: Tobias Klauser <tobias@cilium.io>
    tklauser authored and aanm committed Feb 17, 2024
    Configuration menu
    Copy the full SHA
    01dcc21 View commit details
    Browse the repository at this point in the history