jmattheis / goverter

Generate type-safe Go converters by simply defining an interface
https://goverter.jmattheis.de/
MIT License
502 stars 47 forks source link

Distinguish empty map types #126

Closed yxu1111 closed 8 months ago

yxu1111 commented 8 months ago

Describe the bug A nil map is always converted to an empty map ({}) which sometimes could cause issues if the caller treats them differently

To Reproduce pass in a member variable that is a map of value nil will return a map of value '{}'

Expected behavior Ideally it should keep the original behavior - nil to nil and {} to {}

Thanks!

jmattheis commented 8 months ago

Thanks for the report, could you try out the map-nil branch and verify the problem is fixed for you?

yxu1111 commented 8 months ago

yes, it works great! Thank you for your in-time response and quick fix!

jmattheis commented 8 months ago

Released with v1.3.1.