deepCopy DeepCopy makes deep copies of things: unexported field values are not copied. Import go get -u github.com/black-06/deepcopy-v2 Usage cpy := deepcopy.Copy(orig) Features NEW Generics based implementation ( requires Go 1.18 or higher)