Concisely deep copy a slice?
Not sure which solution is fastest without a benchmark, but an alternative is using the built in copy: cpy := make([]T, len(orig)) copy(cpy, orig) From the documentation: func copy(dst, src []Type) int The copy built-in function copies elements from a source slice into a destination slice. (As a special case, it also will copy bytes … Read more