MutableBody returns a deep copy of the given document revision as a plain body (without any special properties) Callers are free to modify any of this body without affecting the document revision.
()
| 224 | // MutableBody returns a deep copy of the given document revision as a plain body (without any special properties) |
| 225 | // Callers are free to modify any of this body without affecting the document revision. |
| 226 | func (rev *DocumentRevision) MutableBody() (b Body, err error) { |
| 227 | if err := b.Unmarshal(rev.BodyBytes); err != nil { |
| 228 | return nil, err |
| 229 | } |
| 230 | |
| 231 | return b, nil |
| 232 | } |
| 233 | |
| 234 | // Body returns an unmarshalled body that is kept in the document revision to produce shallow copies. |
| 235 | // If an unmarshalled copy is not available in the document revision, it makes a copy from the raw body |