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

chore(deps): update exp module #120

Closed

Conversation

loderunner
Copy link

Rationale

The slices package in the golang.org/x/exp has changed the signature of comparison functions from returning a bool to returning an int.

This breaking change impacts Go programs relying on circle-policy-agent with a more recent version of the exp module, and prevents them from building.

[email protected]/cpa/tester/runner.go:164:30: type func(a NamedTest, b NamedTest) bool of func(a, b NamedTest) bool {…} does not match inferred type func(a NamedTest, b NamedTest) int for func(a E, b E) int

This PR updates the exp package and fixes the usage of slices.SortFunc to reflect the new signature.

Changes

  • Update the golang.org/x/exp module to v0.0.0-20231206192017-f3f8817b8deb
  • Fix usage of slices.SortFunc to reflect breaking changes in the golang.org/x/exp module

@loderunner loderunner requested a review from a team as a code owner December 8, 2023 09:52
Copy link
Contributor

@jbialy jbialy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@gosuku gosuku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@loderunner
Copy link
Author

I don't see where this should change. As far as I understand, the function passed as argument toIndexFunc has not changed signature, and still returns a bool. Am I missing something? 🤔

@gosuku
Copy link
Contributor

gosuku commented Dec 8, 2023

Yes, my bad actually that was my misread of the return type of IndexFunc as the return type of the func parameter.

Copy link
Contributor

@gosuku gosuku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vallieres
Copy link
Contributor

Closing, as this change was rolled in another pull request. We don't require the x/exp dependency anymore.

@vallieres vallieres closed this Dec 10, 2024
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.

4 participants