Wow! Thanks everyone!

So if I got this right, Go always makes a copy but whats actually being 
copied differs by type. 

It seems that I don't need to worry about a lot of data being copied about 
with the larger data structures, but by passing the pointer value by 
default isn't that an implicit pass-by-reference?





On Tuesday, April 18, 2017 at 2:13:14 PM UTC-7, st ov wrote:
>
> I read everything is pass-by-value in Go, is that correct? 
> What does it encompass? Are there any exceptions?
>
> Does that mean the following:
>
> int passes full integer byte value
> float64 passes full float byte value
> string passes full string []byte value
> slice passes pointer value to slice in memory
> map passes pointer value to map in memory
> func passes pointer value to func in memory
> interface passes pointer value to interface object in memory
>
>
>

-- 
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