4 ms·
Ok, I think I just understood the problem. The following would cause a problem: s0 := append([]string{}, "zoo") sa := append(s0, "foo") sb := append(s
by sly010 5y ago
Ok, I think I just understood the problem.
The following would cause a problem:
s0 := append([]string{}, "zoo")
sa := append(s0, "foo")
sb := append(s0, "bar") // overwrites sa[1]
Go is truly unique in this sense, and you could not actually treat go slices as immutable structures. Point taken.