-
Notifications
You must be signed in to change notification settings - Fork 246
feat(tree): modify children of existing Tree
#461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
} | ||
case Node: | ||
nodes = append(nodes, item) | ||
case fmt.Stringer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be useful to support encoding.TextMarshaler
as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have this in other type checks in tree
, maybe something we can add down the line
Need to look at the feedback from #452 more closely |
This allows users to modify existing
Trees
. In the current version of this table, there is no way to change existing children outside of adding a new child withTree.Child()
.This also handles operations on
Leaf
types to turn them intoTrees
.See examples for usage on these changes. Those examples are testable, so see their output in comment to see how these API changes work.
Related: #452