[go] builtin: add documentation for min/max

8 views
Skip to first unread message

Cuong Manh Le (Gerrit)

unread,
May 26, 2023, 12:14:13 AM5/26/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Cuong Manh Le has uploaded this change for review.

View Change

builtin: add documentation for min/max

Updates #59488

Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
---
M src/builtin/builtin.go
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/builtin/builtin.go b/src/builtin/builtin.go
index bcfb7ce..473fdd2 100644
--- a/src/builtin/builtin.go
+++ b/src/builtin/builtin.go
@@ -10,6 +10,8 @@
*/
package builtin

+import "cmp"
+
// bool is the set of boolean values, true and false.
type bool bool

@@ -206,6 +208,14 @@
// unbuffered.
func make(t Type, size ...IntegerType) Type

+// The max built-in computes the largest value of a fixed number of arguments of
+// [cmp.Ordered] types. There must be at least one argument.
+func max[T cmp.Ordered](x T, y ...T) T
+
+// The min built-in computes the smallest value of a fixed number of arguments of
+// [cmp.Ordered] types. There must be at least one argument.
+func min[T cmp.Ordered](x T, y ...T) T
+
// The new built-in function allocates memory. The first argument is a type,
// not a value, and the value returned is a pointer to a newly
// allocated zero value of that type.

To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
Gerrit-Change-Number: 498495
Gerrit-PatchSet: 1
Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>

Cuong Manh Le (Gerrit)

unread,
May 26, 2023, 12:14:32 AM5/26/23
to goph...@pubsubhelper.golang.org, Robert Griesemer, Matthew Dempsky, golang-co...@googlegroups.com

Attention is currently required from: Matthew Dempsky, Robert Griesemer.

Patch set 1:Run-TryBot +1

View Change

    To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
    Gerrit-Change-Number: 498495
    Gerrit-PatchSet: 1
    Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
    Gerrit-Reviewer: Robert Griesemer <g...@google.com>
    Gerrit-Attention: Robert Griesemer <g...@google.com>
    Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
    Gerrit-Comment-Date: Fri, 26 May 2023 04:14:25 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    Cuong Manh Le (Gerrit)

    unread,
    May 26, 2023, 12:35:58 AM5/26/23
    to goph...@pubsubhelper.golang.org, Gopher Robot, Robert Griesemer, Matthew Dempsky, golang-co...@googlegroups.com

    Attention is currently required from: Matthew Dempsky, Robert Griesemer.

    View Change

    1 comment:

    To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
    Gerrit-Change-Number: 498495
    Gerrit-PatchSet: 1
    Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
    Gerrit-Reviewer: Robert Griesemer <g...@google.com>
    Gerrit-Attention: Robert Griesemer <g...@google.com>
    Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
    Gerrit-Comment-Date: Fri, 26 May 2023 04:35:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Ian Lance Taylor (Gerrit)

    unread,
    May 26, 2023, 1:13:35 PM5/26/23
    to Cuong Manh Le, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Gopher Robot, Robert Griesemer, Matthew Dempsky, golang-co...@googlegroups.com

    Attention is currently required from: Cuong Manh Le, Matthew Dempsky, Robert Griesemer.

    View Change

    1 comment:

    • File src/builtin/builtin.go:

      • Patch Set #1, Line 211: // The max built-in computes the largest value of a fixed number of arguments of

        Everywhere else I think we say "built-in function", not just "built-in".

    To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
    Gerrit-Change-Number: 498495
    Gerrit-PatchSet: 1
    Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
    Gerrit-Reviewer: Robert Griesemer <g...@google.com>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Attention: Robert Griesemer <g...@google.com>
    Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
    Gerrit-Comment-Date: Fri, 26 May 2023 17:13:32 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Cuong Manh Le (Gerrit)

    unread,
    May 26, 2023, 1:18:09 PM5/26/23
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Cuong Manh Le, Matthew Dempsky, Robert Griesemer.

    Cuong Manh Le uploaded patch set #2 to this change.

    View Change

    The following approvals got outdated and were removed: Run-TryBot+1 by Cuong Manh Le, TryBot-Result-1 by Gopher Robot

    builtin: add documentation for min/max

    Updates #59488

    Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
    ---
    M src/builtin/builtin.go
    1 file changed, 10 insertions(+), 0 deletions(-)

    To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
    Gerrit-Change-Number: 498495
    Gerrit-PatchSet: 2

    Cuong Manh Le (Gerrit)

    unread,
    May 26, 2023, 1:18:25 PM5/26/23
    to goph...@pubsubhelper.golang.org, Ian Lance Taylor, Gopher Robot, Robert Griesemer, Matthew Dempsky, golang-co...@googlegroups.com

    Attention is currently required from: Ian Lance Taylor, Matthew Dempsky, Robert Griesemer.

    Patch set 1:Run-TryBot +1

    View Change

    1 comment:

    • File src/builtin/builtin.go:

      • Patch Set #1, Line 211: // The max built-in computes the largest value of a fixed number of arguments of

        Everywhere else I think we say "built-in function", not just "built-in".

      • Acknowledged

    To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
    Gerrit-Change-Number: 498495
    Gerrit-PatchSet: 1
    Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
    Gerrit-Reviewer: Robert Griesemer <g...@google.com>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Robert Griesemer <g...@google.com>
    Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
    Gerrit-Comment-Date: Fri, 26 May 2023 17:18:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>

    Cuong Manh Le (Gerrit)

    unread,
    May 26, 2023, 1:44:22 PM5/26/23
    to goph...@pubsubhelper.golang.org, Ian Lance Taylor, Gopher Robot, Robert Griesemer, Matthew Dempsky, golang-co...@googlegroups.com

    Attention is currently required from: Ian Lance Taylor, Matthew Dempsky, Robert Griesemer.

    Patch set 2:Run-TryBot +1

    View Change

      To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
      Gerrit-Change-Number: 498495
      Gerrit-PatchSet: 2
      Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
      Gerrit-Reviewer: Robert Griesemer <g...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Robert Griesemer <g...@google.com>
      Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
      Gerrit-Comment-Date: Fri, 26 May 2023 17:44:17 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      Matthew Dempsky (Gerrit)

      unread,
      May 26, 2023, 3:52:22 PM5/26/23
      to Cuong Manh Le, goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Robert Griesemer, golang-co...@googlegroups.com

      Attention is currently required from: Cuong Manh Le, Ian Lance Taylor, Robert Griesemer.

      Patch set 2:Code-Review +2

      View Change

      1 comment:

      • File src/builtin/builtin.go:

        • Patch Set #2, Line 211: computes

          nit: While "computes" is the wording the spec uses, I think "returns" is more natural wording in godocs.

          gri/iant: WDYT?

      To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
      Gerrit-Change-Number: 498495
      Gerrit-PatchSet: 2
      Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
      Gerrit-Reviewer: Robert Griesemer <g...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Robert Griesemer <g...@google.com>
      Gerrit-Comment-Date: Fri, 26 May 2023 19:52:18 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes

      Ian Lance Taylor (Gerrit)

      unread,
      May 26, 2023, 3:53:30 PM5/26/23
      to Cuong Manh Le, goph...@pubsubhelper.golang.org, Matthew Dempsky, Gopher Robot, Ian Lance Taylor, Robert Griesemer, golang-co...@googlegroups.com

      Attention is currently required from: Cuong Manh Le, Matthew Dempsky, Robert Griesemer.

      View Change

      1 comment:

      • File src/builtin/builtin.go:

        • nit: While "computes" is the wording the spec uses, I think "returns" is more natural wording in god […]

          I agree.

      To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
      Gerrit-Change-Number: 498495
      Gerrit-PatchSet: 2
      Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
      Gerrit-Reviewer: Robert Griesemer <g...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
      Gerrit-Attention: Robert Griesemer <g...@google.com>
      Gerrit-Comment-Date: Fri, 26 May 2023 19:53:25 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Matthew Dempsky <mdem...@google.com>

      Robert Griesemer (Gerrit)

      unread,
      May 26, 2023, 5:58:35 PM5/26/23
      to Cuong Manh Le, goph...@pubsubhelper.golang.org, Matthew Dempsky, Gopher Robot, Ian Lance Taylor, golang-co...@googlegroups.com

      Attention is currently required from: Cuong Manh Le, Ian Lance Taylor, Matthew Dempsky.

      View Change

      1 comment:

      • File src/builtin/builtin.go:

        • I agree.

          ACK.

      To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
      Gerrit-Change-Number: 498495
      Gerrit-PatchSet: 2
      Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
      Gerrit-Reviewer: Robert Griesemer <g...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
      Gerrit-Comment-Date: Fri, 26 May 2023 21:58:32 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>
      Comment-In-Reply-To: Matthew Dempsky <mdem...@google.com>

      Cuong Manh Le (Gerrit)

      unread,
      May 26, 2023, 8:56:52 PM5/26/23
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Cuong Manh Le, Ian Lance Taylor, Matthew Dempsky.

      Cuong Manh Le uploaded patch set #3 to this change.

      View Change

      The following approvals got outdated and were removed: Run-TryBot+1 by Cuong Manh Le, TryBot-Result-1 by Gopher Robot

      builtin: add documentation for min/max

      Updates #59488

      Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
      ---
      M src/builtin/builtin.go
      1 file changed, 10 insertions(+), 0 deletions(-)

      To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
      Gerrit-Change-Number: 498495
      Gerrit-PatchSet: 3

      Cuong Manh Le (Gerrit)

      unread,
      May 26, 2023, 8:57:35 PM5/26/23
      to goph...@pubsubhelper.golang.org, Matthew Dempsky, Gopher Robot, Ian Lance Taylor, Robert Griesemer, golang-co...@googlegroups.com

      Attention is currently required from: Ian Lance Taylor, Matthew Dempsky, Robert Griesemer.

      Patch set 3:Run-TryBot +1

      View Change

      1 comment:

      • File src/builtin/builtin.go:

        • ACK.

          Done.

      To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
      Gerrit-Change-Number: 498495
      Gerrit-PatchSet: 3
      Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
      Gerrit-Reviewer: Robert Griesemer <g...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Robert Griesemer <g...@google.com>
      Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
      Gerrit-Comment-Date: Sat, 27 May 2023 00:57:29 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>
      Comment-In-Reply-To: Robert Griesemer <g...@google.com>
      Comment-In-Reply-To: Matthew Dempsky <mdem...@google.com>

      Ian Lance Taylor (Gerrit)

      unread,
      May 29, 2023, 7:07:24 PM5/29/23
      to Cuong Manh Le, goph...@pubsubhelper.golang.org, Gopher Robot, Matthew Dempsky, Ian Lance Taylor, Robert Griesemer, golang-co...@googlegroups.com

      Attention is currently required from: Cuong Manh Le, Ian Lance Taylor, Matthew Dempsky, Robert Griesemer.

      Patch set 3:Code-Review +2

      View Change

      1 comment:

      • Patchset:

        • Patch Set #3:

          LGTM but I'm not sure whether we can commit this yet given the x/tools test failure.

      To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
      Gerrit-Change-Number: 498495
      Gerrit-PatchSet: 3
      Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
      Gerrit-Reviewer: Robert Griesemer <g...@google.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Cuong Manh Le <cuong.m...@gmail.com>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Robert Griesemer <g...@google.com>
      Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
      Gerrit-Comment-Date: Mon, 29 May 2023 23:07:21 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes

      Cuong Manh Le (Gerrit)

      unread,
      Jun 4, 2023, 11:00:15 AM6/4/23
      to goph...@pubsubhelper.golang.org, Gopher Robot, Matthew Dempsky, Ian Lance Taylor, Robert Griesemer, golang-co...@googlegroups.com

      Attention is currently required from: Ian Lance Taylor, Matthew Dempsky, Robert Griesemer.

      Patch set 4:Run-TryBot +1Auto-Submit +1

      View Change

        To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
        Gerrit-Change-Number: 498495
        Gerrit-PatchSet: 4
        Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
        Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
        Gerrit-Reviewer: Robert Griesemer <g...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Robert Griesemer <g...@google.com>
        Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
        Gerrit-Comment-Date: Sun, 04 Jun 2023 15:00:09 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes

        Cuong Manh Le (Gerrit)

        unread,
        Jun 4, 2023, 11:01:05 AM6/4/23
        to goph...@pubsubhelper.golang.org, Gopher Robot, Matthew Dempsky, Ian Lance Taylor, Robert Griesemer, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Matthew Dempsky, Robert Griesemer.

        View Change

        1 comment:

        • Patchset:

          • Patch Set #3:

            LGTM but I'm not sure whether we can commit this yet given the x/tools test failure.

        To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
        Gerrit-Change-Number: 498495
        Gerrit-PatchSet: 4
        Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
        Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-Reviewer: Matthew Dempsky <mdem...@google.com>
        Gerrit-Reviewer: Robert Griesemer <g...@google.com>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Robert Griesemer <g...@google.com>
        Gerrit-Attention: Matthew Dempsky <mdem...@google.com>
        Gerrit-Comment-Date: Sun, 04 Jun 2023 15:00:59 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Ian Lance Taylor <ia...@google.com>

        Gopher Robot (Gerrit)

        unread,
        Jun 4, 2023, 11:12:50 AM6/4/23
        to Cuong Manh Le, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Matthew Dempsky, Ian Lance Taylor, Robert Griesemer, golang-co...@googlegroups.com

        Gopher Robot submitted this change.

        View Change



        3 is the latest approved patch-set.
        No files were changed between the latest approved patch-set and the submitted one.

        Approvals: Gopher Robot: TryBots succeeded Matthew Dempsky: Looks good to me, approved Ian Lance Taylor: Looks good to me, approved Cuong Manh Le: Run TryBots; Automatically submit change
        builtin: add documentation for min/max

        Updates #59488

        Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
        Reviewed-on: https://go-review.googlesource.com/c/go/+/498495
        TryBot-Result: Gopher Robot <go...@golang.org>
        Reviewed-by: Ian Lance Taylor <ia...@google.com>
        Auto-Submit: Cuong Manh Le <cuong.m...@gmail.com>
        Reviewed-by: Matthew Dempsky <mdem...@google.com>
        Run-TryBot: Cuong Manh Le <cuong.m...@gmail.com>

        ---
        M src/builtin/builtin.go
        1 file changed, 10 insertions(+), 0 deletions(-)

        
        
        diff --git a/src/builtin/builtin.go b/src/builtin/builtin.go
        index bcfb7ce..03e90c8 100644

        --- a/src/builtin/builtin.go
        +++ b/src/builtin/builtin.go
        @@ -10,6 +10,8 @@
        */
        package builtin

        +import "cmp"
        +
        // bool is the set of boolean values, true and false.
        type bool bool

        @@ -206,6 +208,14 @@
        // unbuffered.
        func make(t Type, size ...IntegerType) Type

        +// The max built-in function returns the largest value of a fixed number of
        +// arguments of [cmp.Ordered] types. There must be at least one argument.

        +func max[T cmp.Ordered](x T, y ...T) T
        +
        +// The min built-in function returns the smallest value of a fixed number of
        +// arguments of [cmp.Ordered] types. There must be at least one argument.

        +func min[T cmp.Ordered](x T, y ...T) T
        +
        // The new built-in function allocates memory. The first argument is a type,
        // not a value, and the value returned is a pointer to a newly
        // allocated zero value of that type.

        To view, visit change 498495. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-MessageType: merged
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: If873b81fb7f0e28b84a3e5c2ff89426b3e289d5d
        Gerrit-Change-Number: 498495
        Gerrit-PatchSet: 5
        Reply all
        Reply to author
        Forward
        0 new messages