Skip to content

Unexported struct fields which are pointers are not deep copied #212

@anandsunderraman

Description

@anandsunderraman

Reproducible Example

https://go.dev/play/p/xa2-zmGBrU9

Description

Refer to the example above.

type Address struct {
	Street string
	City   string
}

type Person struct {
	Name string
	Age  int
	addr *Address
}

If a struct has an unexported field and if it is a pointer then DeepCopy of this unexported pointer does not happen.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions