jinzhu / copier

Copier for golang, copy value from struct to struct and more
MIT License
5.58k stars 489 forks source link

Does not create deep copy #110

Open debasish-mihup opened 3 years ago

debasish-mihup commented 3 years ago

https://play.golang.org/p/IYQlesIxpD1

Trying to deep copy a slice of struct but it is not working as all the copies are pointing to original and thus changing the copy affects the original

bAngerman commented 2 years ago

The fields of the struct must be exported in order to copy them.

see https://go.dev/play/p/q_eCLQqfUXE

Rmaan commented 1 year ago

This should be written in big letters in the readme 😂, it makes this library less useful as a usual use case is to copy structs from other packages with unexported fields.