We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version devel go1.24-140308837f Mon Oct 21 15:30:47 2024 +0200 darwin/arm64
The return value of copy is guaranteed to be <= len(x) for x being both the arguments, so the following function shouldn't have bounds checks.
<= len(x)
func foo(a, b []byte) { n := copy(a, b) _ = a[n:] // bounds check! _ = b[n:] // bounds check! }
The text was updated successfully, but these errors were encountered:
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Sorry, something went wrong.
Duplicate of #16833.
No branches or pull requests
The return value of copy is guaranteed to be
<= len(x)
for x being both the arguments, so the following function shouldn't have bounds checks.The text was updated successfully, but these errors were encountered: