lerenn / asyncapi-codegen

An AsyncAPI Golang Code generator that generates all Go code from the broker to the application/user. Just plug your application to your favorite message broker!
Apache License 2.0
76 stars 21 forks source link

Fix: Resolve date formats handling #231

Closed TheSadlig closed 2 weeks ago

TheSadlig commented 4 weeks ago

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

lerenn commented 3 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 :

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 :)

TheSadlig commented 2 weeks ago

@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