8000 ordered generics type max min value should be define · Issue #71493 · golang/go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ordered generics type max min value should be define #71493

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

Closed
runsys opened this issue Jan 31, 2025 · 3 comments
Closed
8000

ordered generics type max min value should be define #71493

runsys opened this issue Jan 31, 2025 · 3 comments
Labels
LanguageProposal Issues describing a requested change to the Go language specification.

Comments

@runsys
Copy link
runsys commented Jan 31, 2025

I need the max min for my function.
but in generics function I can not get them.

@gabyhelp gabyhelp added the LanguageProposal Issues describing a requested change to the Go language specification. label Jan 31, 2025
@adonovan
Copy link
Member

max and min are defined for all built-in ordered types: strings, integers, and floating-point numbers.

For your own data types that are not represented this way, you'll need to write your own min function or less-than operator, which is not hard.

I'm going to close this issue. Feel free to reopen it if you have a specific question or request.

@adonovan adonovan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2025
@ianlancetaylor
Copy link
Contributor

For questions please use a forum, not the issue tracker. See https://go.dev/wiki/Questions. Thanks.

@zigo101
Copy link
zigo101 commented Jan 31, 2025
5F11

this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LanguageProposal Issues describing a requested change to the Go language specification.
Projects
None yet
Development

No branches or pull requests

5 participants
0