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

strings,bytes: improve Repeat panic messages #67068

Closed
wants to merge 16 commits into from

Conversation

go101
Copy link

@go101 go101 commented Apr 26, 2024

The Repeat("-", maxInt) call should produce

panic: runtime error: makeslice: len out of range

instead of

panic: strings: Repeat output length overflow

This PR is only for theory perfection.

@gopherbot
Copy link

This PR (HEAD: 191bb36) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/581936.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Xu Liu:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 1: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 1:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-04-26T22:08:37Z","revision":"8c914e0d95bbb993a7acf63e38499244d7b1c10a"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 1: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 1:

This CL has failed the run. Reason:

Tryjob golang/try/gotip-linux-arm64-boringcrypto has failed with summary (view all results):


FAILURE

Tests failed. See all test results.

Error:

shard 1: failed to run "go tool dist test -json": exit status 1
shard 3: failed to run "go tool dist test -json": exit status 1

Links:


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 1: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

This PR (HEAD: a7a3704) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/581936.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 2: Commit-Queue+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 2:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-04-29T18:04:45Z","revision":"e51bcfa64ae85b5e26c3469709fc6f7bcb490577"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 2: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 2:

This CL has failed the run. Reason:

Tryjob golang/try/gotip-windows-386 has failed with summary (view all results):


FAILURE

Tests failed. See all test results.

Error:

shard 1: failed to run "go tool dist test -json": exit status 1
shard 3: failed to run "go tool dist test -json": exit status 1

Links:


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 2: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@go101 go101 changed the title strings,bytes: imporve Repeat panic messages strings,bytes: improve Repeat panic messages Apr 29, 2024
@gopherbot
Copy link

This PR (HEAD: ea39d1f) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/581936.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link

This PR (HEAD: 363faf8) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/581936.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link

Message from Xu Liu:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 5: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 5:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-04-29T21:50:37Z","revision":"61a4d54f5ceff69bf62cdaa890395ee44098419c"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 5: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 5:

This CL has failed the run. Reason:

Tryjob golang/try/gotip-linux-amd64-boringcrypto has failed with summary (view all results):


FAILURE

Tests failed. See all test results.

Error: shard 1: failed to run "go tool dist test -json": exit status 1

Links:


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 5: LUCI-TryBot-Result-1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 5: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 5:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-04-29T22:12:42Z","revision":"61a4d54f5ceff69bf62cdaa890395ee44098419c"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 10:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-05-01T16:35:26Z","revision":"0e7adc48aebf8d530e7c602b5b5ebfb5fc067921"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Keith Randall:

Patch Set 10: Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Keith Randall:

Patch Set 10: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 10:

This CL has passed the run


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 10: LUCI-TryBot-Result+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

This PR (HEAD: 31d7cf6) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/581936.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link

Message from Xu Liu:

Patch Set 11:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 11: Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 11:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-05-01T20:56:16Z","revision":"51b71bb9d9c809c05b8d2c11a6abc9c2f8f7d1f9"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 11: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 11:

This CL has passed the run


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 11: LUCI-TryBot-Result+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 11:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

This PR (HEAD: 338bbfc) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/581936.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link

Message from Xu Liu:

Patch Set 12:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Ian Lance Taylor:

Patch Set 12:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

This PR (HEAD: 29dc0cb) has been imported to Gerrit for code review.

Please visit Gerrit at https://go-review.googlesource.com/c/go/+/581936.

Important tips:

  • Don't comment on this PR. All discussion takes place in Gerrit.
  • You need a Gmail or other Google account to log in to Gerrit.
  • To change your code in response to feedback:
    • Push a new commit to the branch used by your GitHub PR.
    • A new "patch set" will then appear in Gerrit.
    • Respond to each comment by marking as Done in Gerrit if implemented as suggested. You can alternatively write a reply.
    • Critical: you must click the blue Reply button near the top to publish your Gerrit responses.
    • Multiple commits in the PR will be squashed by GerritBot.
  • The title and description of the GitHub PR are used to construct the final commit message.
    • Edit these as needed via the GitHub web interface (not via Gerrit or git).
    • You should word wrap the PR description at ~76 characters unless you need longer lines (e.g., for tables or URLs).
  • See the Sending a change via GitHub and Reviews sections of the Contribution Guide as well as the FAQ for details.

@gopherbot
Copy link

Message from Xu Liu:

Patch Set 13:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Keith Randall:

Patch Set 13: Code-Review+2 Commit-Queue+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 13:

Dry run: CV is trying the patch.

Bot data: {"action":"start","triggered_at":"2024-05-03T11:36:18Z","revision":"7744ff186e7ec2ffae9f6fa2bdcaeec0999dd11a"}


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Keith Randall:

Patch Set 13: Auto-Submit+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Keith Randall:

Patch Set 13: -Commit-Queue


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 13:

This CL has passed the run


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link

Message from Go LUCI:

Patch Set 13: LUCI-TryBot-Result+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/581936.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request May 3, 2024
The Repeat("-", maxInt) call should produce

   panic: runtime error: makeslice: len out of range

instead of

   panic: strings: Repeat output length overflow

This PR is only for theory perfection.

Change-Id: If67d87b147d666fbbb7238656f2a0cb6cf1dbb5b
GitHub-Last-Rev: 29dc0cb
GitHub-Pull-Request: #67068
Reviewed-on: https://go-review.googlesource.com/c/go/+/581936
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
@gopherbot
Copy link

This PR is being closed because golang.org/cl/581936 has been merged.

@gopherbot gopherbot closed this May 3, 2024
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.

None yet

3 participants