FAQ

On 1 November 2013 13:46, wrote:

Ok, I understand. So one has to be very careful when passing references
around
(yes)

because the underlying array will get changed but unless the reference is
copied back to the original reference the change won't be reflected.
That's right: the len and cap are parts of the /slice value/, not of the
/underlying array/.

if the size or capacity change. Are pointers to references then the only
way to do this type of manipulation?
You can return the new slice as a result, which is what I'd do
unless there was good reason not to.

Chris

--
Chris "allusive" Dollin

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 12 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 1, '13 at 12:29p
activeNov 3, '13 at 5:22p
posts12
users7
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase