RNode copier

This commit is contained in:
jregan
2020-08-21 17:58:26 -07:00
parent 9b4d4c9d46
commit 24beeb429d
4 changed files with 106 additions and 0 deletions

View File

@@ -168,6 +168,16 @@ type RNode struct {
Match []string
}
// Copy returns a distinct copy.
func (rn *RNode) Copy() *RNode {
if rn == nil {
return nil
}
result := *rn
result.value = CopyYNode(rn.value)
return &result
}
var ErrMissingMetadata = fmt.Errorf("missing Resource metadata")
// Field names