golang的for range第二项实际上是值拷贝,然后struct的值拷贝就是复制一份,这和java和python的class传引用是不一样的。
https://stackoverflow.com/questions/20185511/range-references-instead-values
要达到你的效果,循环内部应该用index访问slice
【 在 nic411 的大作中提到: 】
: type student struct {
: name string
: age int
: ...................
--
FROM 58.32.191.*