103
}
104
105
>
func (ns *Namespace) Clone(mutations ...Mutation) *Namespace {
namespace.go
106
>
// Clone the resolver to get a deep copy of replication state
107
>
clonedResolver := ns.replicationResolver.Clone()
108
>
109
>
cloned := &Namespace{
110
>
info: common.CloneProto(ns.info),
111
>
config: common.CloneProto(ns.config),
112
>
configVersion: ns.configVersion,
113
>
customSearchAttributesMapper: CustomSearchAttributesMapper{
114
>
fieldToAlias: ns.customSearchAttributesMapper.fieldToAlias,
115
>
aliasToField: ns.customSearchAttributesMapper.aliasToField,
116
>
},
117
>
notificationVersion: ns.notificationVersion,
118
>
replicationResolver: clonedResolver,
119
>
}
120
>
121
>
for _, m := range mutations {
122
>
m.apply(cloned)
123
>
}
124
126
}
127