[go] all: use the built-in min/max function

55 views
Skip to first unread message

shuang cui (Gerrit)

unread,
Aug 10, 2023, 11:02:20 PM8/10/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

shuang cui has uploaded this change for review.

View Change

all: use the built-in min/max function

Go1.21 uses min and max as built-in functions, which can be used directly without additional definitions

Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
---
M src/cmd/dist/util.go
M src/internal/fuzz/mutator.go
M src/strconv/ftoa.go
3 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go
index 2eeab18..4d5e358 100644
--- a/src/cmd/dist/util.go
+++ b/src/cmd/dist/util.go
@@ -405,13 +405,6 @@
return "7"
}

-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
-
// elfIsLittleEndian detects if the ELF file is little endian.
func elfIsLittleEndian(fn string) bool {
// read the ELF file header to determine the endianness without using the
diff --git a/src/internal/fuzz/mutator.go b/src/internal/fuzz/mutator.go
index bb96066..4310d57 100644
--- a/src/internal/fuzz/mutator.go
+++ b/src/internal/fuzz/mutator.go
@@ -44,13 +44,6 @@
}
}

-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
-
// mutate performs several mutations on the provided values.
func (m *mutator) mutate(vals []any, maxBytes int) {
// TODO(katiehockman): pull some of these functions into helper methods and
diff --git a/src/strconv/ftoa.go b/src/strconv/ftoa.go
index fcbf4df..c514e66 100644
--- a/src/strconv/ftoa.go
+++ b/src/strconv/ftoa.go
@@ -568,17 +568,3 @@

return dst
}
-
-func min(a, b int) int {
- if a < b {
- return a
- }
- return b
-}
-
-func max(a, b int) int {
- if a > b {
- return a
- }
- return b
-}

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

Gerrit-MessageType: newchange
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
Gerrit-Change-Number: 518276
Gerrit-PatchSet: 1
Gerrit-Owner: shuang cui <imc...@gmail.com>

shuang cui (Gerrit)

unread,
Aug 10, 2023, 11:17:37 PM8/10/23
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Attention is currently required from: Robert Griesemer, Roland Shoemaker, Russ Cox.

shuang cui uploaded patch set #2 to this change.

View Change

all: use the built-in min/max function

Go1.21 uses min and max as built-in functions, which can be used directly without additional definitions

Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
---
M src/cmd/dist/util.go
M src/internal/fuzz/mutator.go
2 files changed, 0 insertions(+), 14 deletions(-)

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

Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
Gerrit-Change-Number: 518276
Gerrit-PatchSet: 2
Gerrit-Owner: shuang cui <imc...@gmail.com>
Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
Gerrit-Reviewer: Russ Cox <r...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Robert Griesemer <g...@golang.org>
Gerrit-Attention: Russ Cox <r...@golang.org>
Gerrit-Attention: Roland Shoemaker <rol...@golang.org>

shuang cui (Gerrit)

unread,
Aug 10, 2023, 11:19:45 PM8/10/23
to goph...@pubsubhelper.golang.org, Robert Griesemer, Roland Shoemaker, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

Attention is currently required from: Robert Griesemer, Roland Shoemaker, Russ Cox.

Patch set 2:Run-TryBot +1

View Change

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

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    Gerrit-Change-Number: 518276
    Gerrit-PatchSet: 2
    Gerrit-Owner: shuang cui <imc...@gmail.com>
    Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
    Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Reviewer: shuang cui <imc...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-Attention: Robert Griesemer <g...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
    Gerrit-Comment-Date: Fri, 11 Aug 2023 03:17:49 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    Ian Lance Taylor (Gerrit)

    unread,
    Aug 10, 2023, 11:21:29 PM8/10/23
    to shuang cui, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Gopher Robot, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

    Attention is currently required from: Robert Griesemer, Roland Shoemaker, Russ Cox, shuang cui.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #2:

        cmd/dist has to build with the bootstrap compiler, which doesn't support min and max as predeclared functions.

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

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    Gerrit-Change-Number: 518276
    Gerrit-PatchSet: 2
    Gerrit-Owner: shuang cui <imc...@gmail.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
    Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Reviewer: shuang cui <imc...@gmail.com>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: shuang cui <imc...@gmail.com>
    Gerrit-Attention: Robert Griesemer <g...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
    Gerrit-Comment-Date: Fri, 11 Aug 2023 03:21:24 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    shuang cui (Gerrit)

    unread,
    Aug 11, 2023, 2:59:32 AM8/11/23
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Robert Griesemer, Roland Shoemaker, Russ Cox, shuang cui.

    shuang cui uploaded patch set #3 to this change.

    View Change

    The following approvals got outdated and were removed: Run-TryBot+1 by shuang cui, TryBot-Result-1 by Gopher Robot

    all: use the built-in min/max function

    Go1.21 uses min and max as built-in functions, which can be used directly without additional definitions

    Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    ---
    M src/internal/fuzz/mutator.go
    1 file changed, 0 insertions(+), 7 deletions(-)

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

    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    Gerrit-Change-Number: 518276
    Gerrit-PatchSet: 3

    shuang cui (Gerrit)

    unread,
    Aug 11, 2023, 3:02:21 AM8/11/23
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Robert Griesemer, Roland Shoemaker, Russ Cox, shuang cui.

    shuang cui uploaded patch set #4 to this change.

    View Change

    internal/fuzz: use the built-in min/max function


    Go1.21 uses min and max as built-in functions, which can be used directly without additional definitions

    Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    ---
    M src/internal/fuzz/mutator.go
    1 file changed, 0 insertions(+), 7 deletions(-)

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

    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    Gerrit-Change-Number: 518276
    Gerrit-PatchSet: 4

    shuang cui (Gerrit)

    unread,
    Aug 11, 2023, 3:03:20 AM8/11/23
    to goph...@pubsubhelper.golang.org, Ian Lance Taylor, Gopher Robot, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

    Attention is currently required from: Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox.

    Patch set 4:Run-TryBot +1

    View Change

    2 comments:

    • Patchset:

      • Patch Set #2:

        cmd/dist has to build with the bootstrap compiler, which doesn't support min and max as predeclared […]

        Thanks your guidance.

      • Patch Set #2:

        45 of 45 TryBots failed. […]

        Done

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

    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    Gerrit-Change-Number: 518276
    Gerrit-PatchSet: 4
    Gerrit-Owner: shuang cui <imc...@gmail.com>
    Gerrit-Reviewer: Gopher Robot <go...@golang.org>
    Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
    Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
    Gerrit-Reviewer: Russ Cox <r...@golang.org>
    Gerrit-Reviewer: shuang cui <imc...@gmail.com>
    Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Robert Griesemer <g...@golang.org>
    Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
    Gerrit-Attention: Russ Cox <r...@golang.org>
    Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
    Gerrit-Comment-Date: Fri, 11 Aug 2023 07:03:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Gopher Robot <go...@golang.org>
    Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>

    shuang cui (Gerrit)

    unread,
    Aug 11, 2023, 3:04:12 AM8/11/23
    to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

    Attention is currently required from: Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox.

    shuang cui uploaded patch set #5 to this change.

    View Change

    internal/fuzz: use the built-in min function

    Go1.21 uses min as built-in functions, which can be used directly without additional definitions


    Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    ---
    M src/internal/fuzz/mutator.go
    1 file changed, 0 insertions(+), 7 deletions(-)

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

    Gerrit-MessageType: newpatchset
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
    Gerrit-Change-Number: 518276
    Gerrit-PatchSet: 5

    qiulaidongfeng (Gerrit)

    unread,
    Aug 11, 2023, 5:24:13 AM8/11/23
    to shuang cui, goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

    Attention is currently required from: Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, shuang cui.

    Patch set 5:Code-Review +1

    View Change

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

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
      Gerrit-Change-Number: 518276
      Gerrit-PatchSet: 5
      Gerrit-Owner: shuang cui <imc...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-Reviewer: shuang cui <imc...@gmail.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: shuang cui <imc...@gmail.com>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
      Gerrit-Comment-Date: Fri, 11 Aug 2023 09:24:06 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes

      Gerrit Bot (Gerrit)

      unread,
      Aug 11, 2023, 8:12:06 AM8/11/23
      to goph...@pubsubhelper.golang.org, 产学红, golang-co...@googlegroups.com

      Gerrit Bot has uploaded this change for review.

      View Change

      all: use the built-in min/max function

      This PR will be imported into Gerrit with the title and first
      comment (this text) used to generate the subject and body of
      the Gerrit change.

      **Please ensure you adhere to every item in this list.**

      More info can be found at https://github.com/golang/go/wiki/CommitMessage

      + The PR title is formatted as follows: `net/http: frob the quux before blarfing`
      + The package name goes before the colon
      + The part after the colon uses the verb tense + phrase that completes the blank in,
      "This change modifies Go to ___________"
      + Lowercase verb after the colon
      + No trailing period
      + Keep the title as short as possible. ideally under 76 characters or shorter
      + No Markdown
      + The first PR comment (this one) is wrapped at 76 characters, unless it's
      really needed (ASCII art, table, or long link)
      + If there is a corresponding issue, add either `Fixes #1234` or `Updates #1234`
      (the latter if this is not a complete fix) to this comment
      + If referring to a repo other than `golang/go` you can use the
      `owner/repo#issue_number` syntax: `Fixes golang/tools#1234`
      + We do not use Signed-off-by lines in Go. Please don't add them.
      Our Gerrit server & GitHub bots enforce CLA compliance instead.
      + Delete these instructions once you have read and applied them

      Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
      GitHub-Last-Rev: 8d014c2ad350c237a135054a6a4e120ea6453be7
      GitHub-Pull-Request: golang/go#61955
      ---
      M src/cmd/compile/internal/abt/avlint32.go
      M src/cmd/compile/internal/ssa/rewrite.go
      M src/cmd/dist/util.go
      M src/go/doc/testdata/benchmark.go
      M src/internal/fuzz/mutator.go
      M src/math/big/nat.go
      M src/math/rand/rand_test.go
      7 files changed, 0 insertions(+), 56 deletions(-)

      diff --git a/src/cmd/compile/internal/abt/avlint32.go b/src/cmd/compile/internal/abt/avlint32.go
      index 28c1642..ddfca34 100644
      --- a/src/cmd/compile/internal/abt/avlint32.go
      +++ b/src/cmd/compile/internal/abt/avlint32.go
      @@ -819,13 +819,6 @@
      return left
      }

      -func max(a, b int8) int8 {

      - if a > b {
      - return a
      - }
      - return b
      -}
      -
       func (t *node32) copy() *node32 {
      u := *t
      return &u
      diff --git a/src/cmd/compile/internal/ssa/rewrite.go b/src/cmd/compile/internal/ssa/rewrite.go
      index 6ee661d..aeb0d17 100644
      --- a/src/cmd/compile/internal/ssa/rewrite.go
      +++ b/src/cmd/compile/internal/ssa/rewrite.go
      @@ -1177,13 +1177,6 @@

      var ruleFile io.Writer

      -func min(x, y int64) int64 {
      - if x < y {
      - return x
      - }
      - return y
      -}
      -
      func isConstZero(v *Value) bool {
      switch v.Op {
      case OpConstNil:

      diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go
      index 2eeab18..4d5e358 100644
      --- a/src/cmd/dist/util.go
      +++ b/src/cmd/dist/util.go
      @@ -405,13 +405,6 @@
      return "7"
      }

      -func min(a, b int) int {
      - if a < b {
      - return a
      - }
      - return b
      -}
      -
      // elfIsLittleEndian detects if the ELF file is little endian.
      func elfIsLittleEndian(fn string) bool {
      // read the ELF file header to determine the endianness without using the
      diff --git a/src/go/doc/testdata/benchmark.go b/src/go/doc/testdata/benchmark.go
      index dbf6b4f..b3732f2 100644
      --- a/src/go/doc/testdata/benchmark.go
      +++ b/src/go/doc/testdata/benchmark.go
      @@ -85,20 +85,6 @@
      b.StopTimer()
      }

      -func min(x, y int) int {
      - if x > y {
      - return y
      - }
      - return x
      -}
      -
      -func max(x, y int) int {
      - if x < y {
      - return y
      - }
      - return x
      -}
      -
      // roundDown10 rounds a number down to the nearest power of 10.
      func roundDown10(n int) int {
      var tens = 0

      diff --git a/src/internal/fuzz/mutator.go b/src/internal/fuzz/mutator.go
      index bb96066..4310d57 100644
      --- a/src/internal/fuzz/mutator.go
      +++ b/src/internal/fuzz/mutator.go
      @@ -44,13 +44,6 @@
      }
      }

      -func min(a, b int) int {
      - if a < b {
      - return a
      - }
      - return b
      -}
      -
      // mutate performs several mutations on the provided values.
      func (m *mutator) mutate(vals []any, maxBytes int) {
      // TODO(katiehockman): pull some of these functions into helper methods and
      diff --git a/src/math/big/nat.go b/src/math/big/nat.go
      index 90ce6d1..b9f4026 100644
      --- a/src/math/big/nat.go
      +++ b/src/math/big/nat.go
      @@ -389,13 +389,6 @@
      }
      }

      -func max(x, y int) int {
      - if x > y {
      - return x
      - }
      - return y
      -}
      -
      // karatsubaLen computes an approximation to the maximum k <= n such that
      // k = p<<i for a number p <= threshold and an i >= 0. Thus, the
      // result is the largest number that can be divided repeatedly by 2 before
      diff --git a/src/math/rand/rand_test.go b/src/math/rand/rand_test.go
      index 7eba1dc..4ad2ae2 100644
      --- a/src/math/rand/rand_test.go
      +++ b/src/math/rand/rand_test.go
      @@ -33,13 +33,6 @@
      maxError float64
      }

      -func max(a, b float64) float64 {

      - if a > b {
      - return a
      - }
      - return b
      -}
      -
       func nearEqual(a, b, closeEnough, maxError float64) bool {
      absDiff := math.Abs(a - b)
      if absDiff < closeEnough { // Necessary when one value is zero and one value is close to zero.

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

      Gerrit-MessageType: newchange
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
      Gerrit-Change-Number: 518595
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-CC: 产学红 <chanx...@gmail.com>

      Ian Lance Taylor (Gerrit)

      unread,
      Aug 11, 2023, 2:01:06 PM8/11/23
      to shuang cui, goph...@pubsubhelper.golang.org, qiulaidongfeng, Gopher Robot, Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

      Attention is currently required from: Robert Griesemer, Roland Shoemaker, Russ Cox, shuang cui.

      View Change

      1 comment:

      • Commit Message:

        • Patch Set #5, Line 9: Go1.21 uses min as built-in functions, which can be used directly without additional definitions

          You can just remove this paragraph. The topic is enough. Thanks.

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

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
      Gerrit-Change-Number: 518276
      Gerrit-PatchSet: 5
      Gerrit-Owner: shuang cui <imc...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-Reviewer: shuang cui <imc...@gmail.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: shuang cui <imc...@gmail.com>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
      Gerrit-Comment-Date: Fri, 11 Aug 2023 18:01:00 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Ian Lance Taylor (Gerrit)

      unread,
      Aug 11, 2023, 2:01:54 PM8/11/23
      to Gerrit Bot, 产学红, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Robert Griesemer, Keith Randall, Roland Shoemaker, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Keith Randall, Robert Griesemer, Roland Shoemaker.

      View Change

      2 comments:

      • Patchset:

        • Patch Set #1:

          Please run all.bash with your changes. I think you'll find some errors.

      • Commit Message:

        • Patch Set #1, Line 9: This PR will be imported into Gerrit with the title and first

          Please read and follow these instructions. Thanks.

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

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
      Gerrit-Change-Number: 518595
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-CC: 产学红 <chanx...@gmail.com>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Attention: Keith Randall <k...@golang.org>
      Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
      Gerrit-Comment-Date: Fri, 11 Aug 2023 18:01:49 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      Mauri de Souza Meneguzzo (Gerrit)

      unread,
      Aug 11, 2023, 5:45:22 PM8/11/23
      to Gerrit Bot, 产学红, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Robert Griesemer, Keith Randall, Roland Shoemaker, Gopher Robot, golang-co...@googlegroups.com

      Attention is currently required from: Keith Randall, Robert Griesemer, Roland Shoemaker.

      View Change

      1 comment:

      • File src/cmd/dist/util.go:

        • Patch Set #1, Line 408: func min(a, b int) int {

          I'm quite sure this won't bootstrap. You might be able to get rid of some of the min/max functions that are not directly involved in bootstrapping tho. I think you will have better luck removing one function at a time and then running all.bash, if you get a failure then revert the change.

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

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
      Gerrit-Change-Number: 518595
      Gerrit-PatchSet: 1
      Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
      Gerrit-Reviewer: Keith Randall <k...@golang.org>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
      Gerrit-CC: 产学红 <chanx...@gmail.com>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Attention: Keith Randall <k...@golang.org>
      Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
      Gerrit-Comment-Date: Fri, 11 Aug 2023 21:45:17 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No

      shuang cui (Gerrit)

      unread,
      Aug 11, 2023, 8:23:37 PM8/11/23
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

      Attention is currently required from: Robert Griesemer, Roland Shoemaker, Russ Cox, shuang cui.

      shuang cui uploaded patch set #6 to this change.

      View Change

      internal/fuzz: use the built-in min function

      Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
      ---
      M src/internal/fuzz/mutator.go
      1 file changed, 0 insertions(+), 7 deletions(-)

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

      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
      Gerrit-Change-Number: 518276
      Gerrit-PatchSet: 6
      Gerrit-Owner: shuang cui <imc...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-Reviewer: shuang cui <imc...@gmail.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: shuang cui <imc...@gmail.com>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>

      shuang cui (Gerrit)

      unread,
      Aug 11, 2023, 8:24:32 PM8/11/23
      to goph...@pubsubhelper.golang.org, qiulaidongfeng, Gopher Robot, Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

      Attention is currently required from: Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox.

      Patch set 6:Run-TryBot +1

      View Change

      1 comment:

      • Commit Message:

        • Patch Set #5, Line 9: Go1.21 uses min as built-in functions, which can be used directly without additional definitions

          You can just remove this paragraph. The topic is enough. Thanks.

        • Done. Thanks

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

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
      Gerrit-Change-Number: 518276
      Gerrit-PatchSet: 6
      Gerrit-Owner: shuang cui <imc...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-Reviewer: shuang cui <imc...@gmail.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
      Gerrit-Comment-Date: Sat, 12 Aug 2023 00:24:26 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes
      Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>

      shuang cui (Gerrit)

      unread,
      Aug 11, 2023, 9:29:41 PM8/11/23
      to goph...@pubsubhelper.golang.org, qiulaidongfeng, Gopher Robot, Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

      Attention is currently required from: Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox.

      View Change

      1 comment:

      • Commit Message:

        • Patch Set #5, Line 9: Go1.21 uses min as built-in functions, which can be used directly without additional definitions

        • Done. […]

          Done

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

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
      Gerrit-Change-Number: 518276
      Gerrit-PatchSet: 6
      Gerrit-Owner: shuang cui <imc...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-Reviewer: shuang cui <imc...@gmail.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
      Gerrit-Comment-Date: Sat, 12 Aug 2023 01:28:06 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: shuang cui <imc...@gmail.com>

      Ian Lance Taylor (Gerrit)

      unread,
      Aug 12, 2023, 1:00:51 AM8/12/23
      to shuang cui, goph...@pubsubhelper.golang.org, qiulaidongfeng, Gopher Robot, Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

      Attention is currently required from: Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, shuang cui.

      Patch set 6:Run-TryBot +1Auto-Submit +1Code-Review +2

      View Change

      1 comment:

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

      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
      Gerrit-Change-Number: 518276
      Gerrit-PatchSet: 6
      Gerrit-Owner: shuang cui <imc...@gmail.com>
      Gerrit-Reviewer: Gopher Robot <go...@golang.org>
      Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
      Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
      Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
      Gerrit-Reviewer: Russ Cox <r...@golang.org>
      Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
      Gerrit-Reviewer: shuang cui <imc...@gmail.com>
      Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: shuang cui <imc...@gmail.com>
      Gerrit-Attention: Robert Griesemer <g...@golang.org>
      Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
      Gerrit-Attention: Russ Cox <r...@golang.org>
      Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
      Gerrit-Comment-Date: Sat, 12 Aug 2023 05:00:45 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: Yes

      Dmitri Shuralyov (Gerrit)

      unread,
      Aug 14, 2023, 5:09:50 PM8/14/23
      to shuang cui, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, qiulaidongfeng, Gopher Robot, Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

      Attention is currently required from: Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, shuang cui.

      Patch set 6:Code-Review +1

      View Change

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

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
        Gerrit-Change-Number: 518276
        Gerrit-PatchSet: 6
        Gerrit-Owner: shuang cui <imc...@gmail.com>
        Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
        Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-Reviewer: Russ Cox <r...@golang.org>
        Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
        Gerrit-Reviewer: shuang cui <imc...@gmail.com>
        Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: shuang cui <imc...@gmail.com>
        Gerrit-Attention: Robert Griesemer <g...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Russ Cox <r...@golang.org>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Comment-Date: Mon, 14 Aug 2023 21:09:46 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes

        Gopher Robot (Gerrit)

        unread,
        Aug 14, 2023, 5:10:11 PM8/14/23
        to shuang cui, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Dmitri Shuralyov, Dmitri Shuralyov, qiulaidongfeng, Ian Lance Taylor, Robert Griesemer, Roland Shoemaker, Russ Cox, golang-co...@googlegroups.com

        Gopher Robot submitted this change.

        View Change

        Approvals: shuang cui: Run TryBots Gopher Robot: TryBots succeeded Ian Lance Taylor: Looks good to me, approved; Run TryBots; Automatically submit change qiulaidongfeng: Looks good to me, but someone else must approve Dmitri Shuralyov: Looks good to me, but someone else must approve
        internal/fuzz: use the built-in min function

        Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
        Reviewed-on: https://go-review.googlesource.com/c/go/+/518276
        Run-TryBot: shuang cui <imc...@gmail.com>
        Reviewed-by: qiulaidongfeng <26454...@qq.com>
        Reviewed-by: Ian Lance Taylor <ia...@google.com>
        TryBot-Result: Gopher Robot <go...@golang.org>
        Auto-Submit: Ian Lance Taylor <ia...@google.com>
        Run-TryBot: Ian Lance Taylor <ia...@google.com>
        Reviewed-by: Dmitri Shuralyov <dmit...@google.com>

        ---
        M src/internal/fuzz/mutator.go
        1 file changed, 0 insertions(+), 7 deletions(-)

        diff --git a/src/internal/fuzz/mutator.go b/src/internal/fuzz/mutator.go
        index bb96066..4310d57 100644
        --- a/src/internal/fuzz/mutator.go
        +++ b/src/internal/fuzz/mutator.go
        @@ -44,13 +44,6 @@
        }
        }

        -func min(a, b int) int {
        - if a < b {
        - return a
        - }
        - return b
        -}
        -
        // mutate performs several mutations on the provided values.
        func (m *mutator) mutate(vals []any, maxBytes int) {
        // TODO(katiehockman): pull some of these functions into helper methods and

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

        Gerrit-MessageType: merged
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I26be9a9faa27c6c03cf8b9dec5908d8617d61312
        Gerrit-Change-Number: 518276
        Gerrit-PatchSet: 7

        Gerrit Bot (Gerrit)

        unread,
        Aug 16, 2023, 2:28:59 AM8/16/23
        to 产学红, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

        Attention is currently required from: Keith Randall, Robert Griesemer, Roland Shoemaker.

        Gerrit Bot uploaded patch set #2 to this change.

        View Change

        all: use the built-in min/max function

        This PR will be imported into Gerrit with the title and first
        comment (this text) used to generate the subject and body of
        the Gerrit change.

        **Please ensure you adhere to every item in this list.**

        More info can be found at https://github.com/golang/go/wiki/CommitMessage

        + The PR title is formatted as follows: `net/http: frob the quux before blarfing`
        + The package name goes before the colon
        + The part after the colon uses the verb tense + phrase that completes the blank in,
        "This change modifies Go to ___________"
        + Lowercase verb after the colon
        + No trailing period
        + Keep the title as short as possible. ideally under 76 characters or shorter
        + No Markdown
        + The first PR comment (this one) is wrapped at 76 characters, unless it's
        really needed (ASCII art, table, or long link)
        + If there is a corresponding issue, add either `Fixes #1234` or `Updates #1234`
        (the latter if this is not a complete fix) to this comment
        + If referring to a repo other than `golang/go` you can use the
        `owner/repo#issue_number` syntax: `Fixes golang/tools#1234`
        + We do not use Signed-off-by lines in Go. Please don't add them.
        Our Gerrit server & GitHub bots enforce CLA compliance instead.
        + Delete these instructions once you have read and applied them

        Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        GitHub-Last-Rev: d3fed409da91a0beaddd7431ac02dedfe4e5b26d
        GitHub-Pull-Request: golang/go#61955
        ---
        M src/math/big/nat.go
        M src/math/rand/rand_test.go
        2 files changed, 0 insertions(+), 14 deletions(-)

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

        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-CC: 产学红 <chanx...@gmail.com>
        Gerrit-Attention: Robert Griesemer <g...@golang.org>

        产学红 (Gerrit)

        unread,
        Aug 16, 2023, 2:34:45 AM8/16/23
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Mauri de Souza Meneguzzo, Ian Lance Taylor, Robert Griesemer, Keith Randall, Roland Shoemaker, Gopher Robot, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        View Change

        3 comments:

        • Patchset:

          • Patch Set #1:

            Please run all.bash with your changes. I think you'll find some errors.

          • Yes, I have found it, thank you.

        • Commit Message:

          • Patch Set #1, Line 9: This PR will be imported into Gerrit with the title and first

            Please read and follow these instructions. Thanks.

          • Sorry, I just saw this today and it has been resolved

        • File src/cmd/dist/util.go:

          • I'm quite sure this won't bootstrap. […]

            Thanks for your advice!

            I have modified it, please review it again.

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

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 2
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Ian Lance Taylor <ia...@golang.org>
        Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-CC: 产学红 <chanx...@gmail.com>
        Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-Attention: Robert Griesemer <g...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Keith Randall <k...@golang.org>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Comment-Date: Wed, 16 Aug 2023 06:34:39 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Mauri de Souza Meneguzzo <maur...@gmail.com>

        Gerrit Bot (Gerrit)

        unread,
        Aug 16, 2023, 2:41:01 AM8/16/23
        to 产学红, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        Gerrit Bot uploaded patch set #3 to this change.

        View Change

        math/big+math/rand: use the built-in min/max function

        Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        GitHub-Last-Rev: bc9b816678e1e192e0ff1328c02ec4a509a908ff

        GitHub-Pull-Request: golang/go#61955
        ---
        M src/math/big/nat.go
        M src/math/rand/rand_test.go
        2 files changed, 0 insertions(+), 14 deletions(-)

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

        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 3

        Ian Lance Taylor (Gerrit)

        unread,
        Aug 16, 2023, 5:54:48 PM8/16/23
        to Gerrit Bot, 产学红, goph...@pubsubhelper.golang.org, Ian Lance Taylor, Mauri de Souza Meneguzzo, Robert Griesemer, Keith Randall, Roland Shoemaker, Gopher Robot, golang-co...@googlegroups.com

        Attention is currently required from: Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        Patch set 3:Run-TryBot +1

        View Change

        1 comment:

        • Commit Message:

          • Patch Set #3, Line 7: math/big+math/rand: use the built-in min/max function

            Use a comma:

            math/big, math/rand: use the built-in min/max function

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

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 3
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-CC: 产学红 <chanx...@gmail.com>
        Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-Attention: Robert Griesemer <g...@golang.org>
        Gerrit-Attention: Keith Randall <k...@golang.org>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Comment-Date: Wed, 16 Aug 2023 21:54:43 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: Yes

        Gerrit Bot (Gerrit)

        unread,
        Aug 16, 2023, 9:31:12 PM8/16/23
        to 产学红, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        Gerrit Bot uploaded patch set #4 to this change.

        View Change

        The following approvals got outdated and were removed: Run-TryBot+1 by Ian Lance Taylor, TryBot-Result+1 by Gopher Robot

        math/big+math/rand: use the built-in min/max function

        Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        GitHub-Last-Rev: ec25534727837d31b5c234da5377e987580c1f0f

        GitHub-Pull-Request: golang/go#61955
        ---
        M src/math/big/nat.go
        M src/math/rand/rand_test.go
        2 files changed, 0 insertions(+), 14 deletions(-)

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

        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 4
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-CC: 产学红 <chanx...@gmail.com>
        Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-Attention: Robert Griesemer <g...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>

        Gerrit Bot (Gerrit)

        unread,
        Aug 16, 2023, 9:42:23 PM8/16/23
        to 产学红, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        Gerrit Bot uploaded patch set #5 to this change.

        View Change

        math/big, math/rand: use the built-in min/max function


        Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        GitHub-Last-Rev: ec25534727837d31b5c234da5377e987580c1f0f
        GitHub-Pull-Request: golang/go#61955
        ---
        M src/math/big/nat.go
        M src/math/rand/rand_test.go
        2 files changed, 0 insertions(+), 14 deletions(-)

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

        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 5

        产学红 (Gerrit)

        unread,
        Aug 16, 2023, 9:44:39 PM8/16/23
        to Gerrit Bot, goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Mauri de Souza Meneguzzo, Robert Griesemer, Keith Randall, Roland Shoemaker, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        View Change

        1 comment:

        • Commit Message:

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

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-CC: 产学红 <chanx...@gmail.com>
        Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-Attention: Robert Griesemer <g...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Keith Randall <k...@golang.org>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Comment-Date: Thu, 17 Aug 2023 01:44:31 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: Ian Lance Taylor <ia...@golang.org>

        qiulaidongfeng (Gerrit)

        unread,
        Aug 16, 2023, 9:50:11 PM8/16/23
        to Gerrit Bot, 产学红, goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Mauri de Souza Meneguzzo, Robert Griesemer, Keith Randall, Roland Shoemaker, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        View Change

        1 comment:

        • Commit Message:

          • Patch Set #5, Line 7: math/big, math/rand: use the built-in min/max function

            This CL only changes max to use built-in functions.
            Please change the submission information to: math/bigs, math/rand: use the build in max function.
            Thanks.

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

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 5
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-CC: qiulaidongfeng <26454...@qq.com>
        Gerrit-CC: 产学红 <chanx...@gmail.com>
        Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-Attention: Robert Griesemer <g...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Keith Randall <k...@golang.org>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Comment-Date: Thu, 17 Aug 2023 01:50:06 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No

        Gerrit Bot (Gerrit)

        unread,
        Aug 16, 2023, 9:58:30 PM8/16/23
        to 产学红, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        Gerrit Bot uploaded patch set #6 to this change.

        View Change

        math/big, math/rand: use the built-in max function

        Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        GitHub-Last-Rev: 8da43b2cbd563ed123690709e519c9f84272b332

        GitHub-Pull-Request: golang/go#61955
        ---
        M src/math/big/nat.go
        M src/math/rand/rand_test.go
        2 files changed, 0 insertions(+), 14 deletions(-)

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

        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 6

        产学红 (Gerrit)

        unread,
        Aug 16, 2023, 9:59:05 PM8/16/23
        to Gerrit Bot, goph...@pubsubhelper.golang.org, qiulaidongfeng, Gopher Robot, Ian Lance Taylor, Mauri de Souza Meneguzzo, Robert Griesemer, Keith Randall, Roland Shoemaker, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker, qiulaidongfeng.

        View Change

        1 comment:

        • Commit Message:

          • This CL only changes max to use built-in functions. […]

            Done

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

        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
        Gerrit-Change-Number: 518595
        Gerrit-PatchSet: 6
        Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
        Gerrit-Reviewer: Gopher Robot <go...@golang.org>
        Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Reviewer: Keith Randall <k...@golang.org>
        Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
        Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
        Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-CC: qiulaidongfeng <26454...@qq.com>
        Gerrit-CC: 产学红 <chanx...@gmail.com>
        Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
        Gerrit-Attention: Robert Griesemer <g...@golang.org>
        Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
        Gerrit-Attention: Keith Randall <k...@golang.org>
        Gerrit-Attention: qiulaidongfeng <26454...@qq.com>
        Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
        Gerrit-Comment-Date: Thu, 17 Aug 2023 01:58:57 +0000
        Gerrit-HasComments: Yes
        Gerrit-Has-Labels: No
        Comment-In-Reply-To: qiulaidongfeng <26454...@qq.com>

        qiulaidongfeng (Gerrit)

        unread,
        Aug 16, 2023, 10:00:22 PM8/16/23
        to Gerrit Bot, 产学红, goph...@pubsubhelper.golang.org, Gopher Robot, Ian Lance Taylor, Mauri de Souza Meneguzzo, Robert Griesemer, Keith Randall, Roland Shoemaker, golang-co...@googlegroups.com

        Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

        Patch set 6:Code-Review +1

        View Change

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

          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
          Gerrit-Change-Number: 518595
          Gerrit-PatchSet: 6
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Reviewer: Keith Randall <k...@golang.org>
          Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
          Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
          Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
          Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
          Gerrit-CC: 产学红 <chanx...@gmail.com>
          Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
          Gerrit-Attention: Robert Griesemer <g...@golang.org>
          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Attention: Keith Randall <k...@golang.org>
          Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
          Gerrit-Comment-Date: Thu, 17 Aug 2023 02:00:17 +0000
          Gerrit-HasComments: No
          Gerrit-Has-Labels: Yes

          Ian Lance Taylor (Gerrit)

          unread,
          Aug 17, 2023, 12:31:41 AM8/17/23
          to Gerrit Bot, 产学红, goph...@pubsubhelper.golang.org, qiulaidongfeng, Gopher Robot, Ian Lance Taylor, Mauri de Souza Meneguzzo, Robert Griesemer, Keith Randall, Roland Shoemaker, golang-co...@googlegroups.com

          Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

          Patch set 6:Run-TryBot +1Auto-Submit +1Code-Review +2

          View Change

          1 comment:

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

          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
          Gerrit-Change-Number: 518595
          Gerrit-PatchSet: 6
          Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
          Gerrit-Reviewer: Gopher Robot <go...@golang.org>
          Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
          Gerrit-Reviewer: Keith Randall <k...@golang.org>
          Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
          Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
          Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
          Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
          Gerrit-CC: 产学红 <chanx...@gmail.com>
          Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
          Gerrit-Attention: Robert Griesemer <g...@golang.org>
          Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
          Gerrit-Attention: Keith Randall <k...@golang.org>
          Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
          Gerrit-Comment-Date: Thu, 17 Aug 2023 04:31:35 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes

          Dmitri Shuralyov (Gerrit)

          unread,
          Aug 17, 2023, 12:42:12 PM8/17/23
          to Gerrit Bot, 产学红, goph...@pubsubhelper.golang.org, Dmitri Shuralyov, Gopher Robot, qiulaidongfeng, Ian Lance Taylor, Mauri de Souza Meneguzzo, Robert Griesemer, Keith Randall, Roland Shoemaker, golang-co...@googlegroups.com

          Attention is currently required from: Ian Lance Taylor, Keith Randall, Mauri de Souza Meneguzzo, Robert Griesemer, Roland Shoemaker.

          Patch set 6:Code-Review +1

          View Change

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

            Gerrit-MessageType: comment
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
            Gerrit-Change-Number: 518595
            Gerrit-PatchSet: 6
            Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
            Gerrit-Reviewer: Dmitri Shuralyov <dmit...@google.com>
            Gerrit-Reviewer: Gopher Robot <go...@golang.org>
            Gerrit-Reviewer: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Reviewer: Ian Lance Taylor <ia...@google.com>
            Gerrit-Reviewer: Keith Randall <k...@golang.org>
            Gerrit-Reviewer: Robert Griesemer <g...@golang.org>
            Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
            Gerrit-Reviewer: qiulaidongfeng <26454...@qq.com>
            Gerrit-CC: Dmitri Shuralyov <dmit...@golang.org>
            Gerrit-CC: Mauri de Souza Meneguzzo <maur...@gmail.com>
            Gerrit-CC: 产学红 <chanx...@gmail.com>
            Gerrit-Attention: Mauri de Souza Meneguzzo <maur...@gmail.com>
            Gerrit-Attention: Robert Griesemer <g...@golang.org>
            Gerrit-Attention: Ian Lance Taylor <ia...@golang.org>
            Gerrit-Attention: Keith Randall <k...@golang.org>
            Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
            Gerrit-Comment-Date: Thu, 17 Aug 2023 16:42:07 +0000
            Gerrit-HasComments: No
            Gerrit-Has-Labels: Yes

            Gopher Robot (Gerrit)

            unread,
            Aug 17, 2023, 12:42:24 PM8/17/23
            to Gerrit Bot, 产学红, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Dmitri Shuralyov, Dmitri Shuralyov, qiulaidongfeng, Ian Lance Taylor, Mauri de Souza Meneguzzo, Robert Griesemer, Keith Randall, Roland Shoemaker, golang-co...@googlegroups.com

            Gopher Robot submitted this change.

            View Change

            Approvals: Ian Lance Taylor: Looks good to me, approved; Run TryBots; Automatically submit change Dmitri Shuralyov: Looks good to me, but someone else must approve qiulaidongfeng: Looks good to me, but someone else must approve Gopher Robot: TryBots succeeded
            math/big, math/rand: use the built-in max function

            Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
            GitHub-Last-Rev: 8da43b2cbd563ed123690709e519c9f84272b332
            GitHub-Pull-Request: golang/go#61955

            Run-TryBot: Ian Lance Taylor <ia...@google.com>
            Reviewed-by: Dmitri Shuralyov <dmit...@google.com>
            TryBot-Result: Gopher Robot <go...@golang.org>
            Auto-Submit: Ian Lance Taylor <ia...@google.com>
            Reviewed-by: Ian Lance Taylor <ia...@google.com>
            Reviewed-by: qiulaidongfeng <26454...@qq.com>

            ---
            M src/math/big/nat.go
            M src/math/rand/rand_test.go
            2 files changed, 0 insertions(+), 14 deletions(-)

            diff --git a/src/math/big/nat.go b/src/math/big/nat.go
            index 90ce6d1..b9f4026 100644
            --- a/src/math/big/nat.go
            +++ b/src/math/big/nat.go
            @@ -389,13 +389,6 @@
            }
            }

            -func max(x, y int) int {
            - if x > y {
            - return x
            - }
            - return y
            -}
            -
            // karatsubaLen computes an approximation to the maximum k <= n such that
            // k = p<<i for a number p <= threshold and an i >= 0. Thus, the
            // result is the largest number that can be divided repeatedly by 2 before
            diff --git a/src/math/rand/rand_test.go b/src/math/rand/rand_test.go
            index 7eba1dc..4ad2ae2 100644
            --- a/src/math/rand/rand_test.go
            +++ b/src/math/rand/rand_test.go
            @@ -33,13 +33,6 @@
            maxError float64
            }

            -func max(a, b float64) float64 {
            -	if a > b {
            - return a
            - }
            - return b
            -}
            -
             func nearEqual(a, b, closeEnough, maxError float64) bool {
            absDiff := math.Abs(a - b)
            if absDiff < closeEnough { // Necessary when one value is zero and one value is close to zero.

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

            Gerrit-MessageType: merged
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: I71a38dd20bfaf2b1aed18892d54eeb017d3d7d66
            Gerrit-Change-Number: 518595
            Gerrit-PatchSet: 7
            Reply all
            Reply to author
            Forward
            0 new messages