spagya
Last Updated: February 25, 2016
·
322
· lukasz-madon
B2bc42f69510d6a1d2c9cde1c2214d24

Go slices trap for python programmers

I'm a python dev learning Go. Here is one subtle difference between python lists and Go slices. Following statment:

b = x[:]

Makes deep copy of list in python, but in Go it's shallow copy.

Say Thanks
Respond