标签:疑难杂症 string for ring 自己 end data amp make
func Test_doSeond(t *testing.T) {
msg := make([]Msg, 0)
for i := 0; i < 5; i++ {
m := Msg{
data: []byte(strconv.Itoa(i)),
addr: "wewe",
}
msg = append(msg, m)
}
m := make([]*Msg, 0)
for _, v := range msg {
m = append(m, &v)
}
for _, v := range m {
fmt.Println(string(v.data))
}
time.Sleep(10 * time.Second)
}
自己跑下结果,会出人意料哦~~~
标签:疑难杂症 string for ring 自己 end data amp make
原文地址:https://www.cnblogs.com/zhouj-happy/p/11744015.html