-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
Feature/#10 merge recursive #140
Feature/#10 merge recursive #140
Conversation
return merged.Clone(), nil | ||
} | ||
|
||
func merge(src, dst core.Value) core.Value { |
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.
If it's a private method and you use it for merging objects, why don't you define its arguments and the output as the*values.Object
type?
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.
because this function can take values of different types at runtime
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.
Looks good! But it needs some changes :)
merged := values.NewObject() | ||
|
||
for _, arg := range args { | ||
merged = merge(merged, arg.(*values.Object)).(*values.Object) |
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.
Ok, do we really need to cast arg
to *values.Object
if merge
accepts core.Value
?
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.
Nope :) My bad
Great! Thank you for your PR. |
No description provided.