Content-Length: 228944 | pFad | http://github.com/golang/go/issues/71493

58 ordered generics type max min value should be define · Issue #71493 · golang/go · GitHub
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

ordered generics type max min value should be define #71493

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

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
Member

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

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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/golang/go/issues/71493

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy