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

Trim unnecessary dependencies for ordered generic constraint. #4709

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

misterpickypants
Copy link
Contributor

A generic test function was introduced in #4515 using constraints.Ordered from golang.org/x/exp/constaints. This unfortunately introduces further transitive dependencies on packages such as golang.org/x/tools which has versions with various breaking changes. This makes it more difficult to pull in nats-server in downstream projects.

By inlining the trivial ordered definition, we can trim this dependency.

An alternative to this change would be to downgrade the required version of golang.org/x/exp since the constraints package has been there (and unchanged) since 2022-02-02.

Signed-off-by: Augusto Roman [email protected]

A generic test function was introduced in nats-io#4515 using
`constraints.Ordered` from golang.org/x/exp/constaints. This
unfortunately introduces further transitive dependencies on packages
such as golang.org/x/tools which has versions with various breaking
changes. This makes it more difficult to pull in nats-server in
downstream projects.

By inlining the trivial `ordered` definition, we can trim this
dependency.

An alternative to this change would be to downgrade the required version
of golang.org/x/exp since the constraints package has been there
(and unchanged) since 2022-02-02.

Signed-off-by: Augusto Roman <[email protected]>
@misterpickypants misterpickypants requested a review from a team as a code owner October 25, 2023 20:33
Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 9671a1f into nats-io:main Oct 25, 2023
2 checks passed
@misterpickypants misterpickypants deleted the trim-deps branch October 25, 2023 21:27
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.

3 participants