package main
import "time"
var x = []string{}
func main() {
go func() {
for {
y := x
y = append(y, "aa")
}
}()
go func() {
for {
x = []string{"123"}
}
}()
for {
time.Sleep(1)
}
}
guess like when x (for example, the address of 123) is not really assigned to y, and x is assigned to a new address like 124. and just this time gc happened, would the address of 123 be recycled and cause a panic?