-
Notifications
You must be signed in to change notification settings - Fork 22
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
matcher: Intended Private Member Field Behavior is Incorrect #39
Comments
Problem: Private Member Field BehaviorCopygen copies the So Copygen performs as expected in this case. With that said, this issue proposes the question on whether Copygen should attempt to match these private member fields. The answer is that matching private member fields is applicable in certain cases, but not always applicable. Therefore, Copygen should not match (copy) private member fields from objects that aren't defined in the generated Solution
Alternatively
|
Problem: Tag BehaviorI cannot confirm whether the specified tagging error exists as you are using an outdated version of Copygen; where tag logic was modified in d4722f4. Please update to the latest version using |
Installing copygen at main doesn't seem to change the behavior with the above test case:
|
I will be able to address these issues in 1 - 3 weeks with the next update of Copygen. |
I like the concept of copygen, where in theory the generated could approach ~20x faster than a
json.Marshal -> protojson.Unmarshal
sandwich (and infinitely faster than jinzhu/copier).However, when using on structs that aren't flat with concrete builtins, things seem to go a little sideways.
Is there something I'm missing on how to handle non-concrete builtin types?
Setup
By default, Created will be ignored because its name/type combo don't match between the structs, which makes sense.
However, with
tag .* json
(which is required in my case) or adding a type override, copygen performs unexpectedly:YML
Go
Generation (
gofmt
ed for better readability)Errors
Copying private member fields isn't going to end well. ;-)
It seems like custom fields confuses the internal type-matching logic.
Operating System: darwin/arm64 or linux/amd64
Copygen Version: latest == v0.4.0
The text was updated successfully, but these errors were encountered: