// expected: a subslice is a copy, so a write through it is not allowed // // Moxie subslicing is ALWAYS a copy: x[1:3] is a new slice holding those two // elements, and it has no address of its own. A store through it therefore // writes into a throwaway that occupies arena space and leaves the original // untouched, which is never what the source meant. The rewrite is resize(p, n) // to move the start of the slice and push(p, v) to write the value. package main func main() { xs := []byte{1, 2, 3, 4} xs[1:3][0] = 9 println(xs[0]) }