通过参考以下示例更改您的范围:for _, elem := range elems { elem = new_val // Won't work, because elem is a copy of // the value from elems}for i := range elems { elems[i] = new_val // Works, because elems[i] deferences // the pointer to the actual value in elems}此外,如果您不修改所有字段,而不是使用Save您也可以使用Update。