Closed TheSadlig closed 2 weeks ago
Really nice work @TheSadlig ! ☺️
I'm all for the use of an external library (less is more in code) which is widely used (so pretty well tested).
I just added to modification :
requiredImports
logic from the project, because it is redundant as the imports
library from the official tools is used in pkg/codegen/codegen.go
removes any unnecessary imports from generated code. So I just added the "cloud.google.com/go/civil" in the imports.tmpl
files and it will be automatically be removed if unused in the go file.requiredImports
, no code where calling the function FieldValueExists
. I could have removed it as well, but I think it will be really useful one day, so I wanted to keep it and unsure that any modification would not change its behavior and added tests.AsyncAPI v3
because it was generated as an AsyncAPI v2.If that's good for you, I'll merge everything but let me know if one of the modification I've made is problematic for you :)
@lerenn Sorry for the late reply.
That's perfect, thanks a lot, I especially like the fact that we don't have to check manually whether the import will be required !
TheSadlig
Hello hello,
In was in need for a fix for #222, so here is a proposition.
I chose to use https://pkg.go.dev/cloud.google.com/go/civil to simplify everything, but another way could have been to implement a struct with a specific marshaller.
Let me know if this works for you,
Thanks, TheSadlig