-
Notifications
You must be signed in to change notification settings - Fork 12
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
Expose Go post-processing utilities #191
Conversation
encoding/gocode/gen.go
Outdated
Path: fmt.Sprintf("%s_type_gen.go", sch.Lineage().Name()), | ||
Appliers: applyFuncs, | ||
In: []byte(gostr), | ||
IgnoreDiscoveredImports: !cfg.IgnoreDiscoveredImports, |
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.
Doesn't it look weird that IgnoreDiscoveredImports: !IgnoreDiscoveredImports
? 🤔
Indeed, now I think it should be IgnoreDiscoveredImports: cfg.IgnoreDiscoveredImports
, because the negation (!
) has been added later, when that value is read.
Also, based on the underlying behavior, I'm not sure if the name is clear enough. I guess nothing that cannot be clarified with some extra explanation in form of docs, if needed.
EDIT: Clearly stated here, so 👌🏻
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.
That's a copy-pasta mistake, good catch!
c9ec821
to
87aa9b8
Compare
87aa9b8
to
f0dba70
Compare
Fixed, documented and added a small test case for it :) |
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.
yeah, definitely worth exposing this
This PR exposes the Go post-processing function, to be used by kindsys and other Go jennies.