-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Consider to make sure append always copies the input slice #10458
Comments
bep
changed the title
Investigate append issue
Make sure append always copies the input slice
Nov 20, 2022
@jmooring I will fixed this pretty fast, but I suspect that you can do:
|
bep
changed the title
Make sure append always copies the input slice
Consider to make sure append always copies the input slice
Nov 20, 2022
bep
added a commit
to bep/hugo
that referenced
this issue
Jun 14, 2023
bep
added a commit
to bep/hugo
that referenced
this issue
Jun 14, 2023
bep
added a commit
to bep/hugo
that referenced
this issue
Jun 14, 2023
Merged
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Go's
append
(andreflect.Append
) reuses the input slice if there is enough capacity, else it creates a new one and copies the content over.The reason we have not seen this bug before is probably
append
you're working on a local slice and the current behaviour makes sense.where
etc.Note that the other collection funcs (where, union etc.) always creates a new slice.
See https://discourse.gohugo.io/t/appending-a-page-to-a-page-collection-append-or-union/41532/10
The text was updated successfully, but these errors were encountered: