method
Value.CopyObject
Create a mutable copy of an object field map.
Example
seo := store.Object(store.Values{"title": store.String("Home")})
fields, ok := seo.CopyObject()
if ok {
fields["title"] = store.String("Welcome")
updated := store.Object(fields)
fmt.Println(updated.Get("title"))
}Returns
A detached field map and a boolean reporting whether the value is an object.
(Values, bool)How it works
Child Values remain immutable. Use Get, Lookup or Entries when only reading.
Full signature
func (value Value) CopyObject() (
Values,
bool,
)