diff --git a/pacta/pacta.go b/pacta/pacta.go index 7a2fd9b..37ab7d4 100644 --- a/pacta/pacta.go +++ b/pacta/pacta.go @@ -340,9 +340,9 @@ type PortfolioProperties struct { func (o PortfolioProperties) Clone() PortfolioProperties { return PortfolioProperties{ HoldingsDate: o.HoldingsDate.Clone(), - ESG: o.ESG, - External: o.External, - EngagementStrategy: o.EngagementStrategy, + ESG: clonePtr(o.ESG), + External: clonePtr(o.External), + EngagementStrategy: clonePtr(o.EngagementStrategy), } } @@ -776,3 +776,11 @@ func cloneAll[T cloneable[T]](in []T) []T { } return out } + +func clonePtr[T any](in *T) *T { + if in == nil { + return nil + } + out := *in + return &out +}