On Mon, Mar 13, 2017 at 9:10 AM, george.robinson via golang-nuts
<golang-nuts@googlegroups.com> wrote:
> Can someone explain to me how this prints "test world" twice? I had expected
> to see "test hello" and "test world".
>
> https://play.golang.org/p/E7CRQNE6oT

m1 is not a pointer, but m1.S is a slice, and a slice is essentially a
pointer and a length (and a capacity, but that's not relevant here).
Read https://blog.golang.org/go-slices-usage-and-internals for more
details.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to