jmattheis / goverter

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

feat(comment): add comment flag #90

Closed peam1146 closed 9 months ago

peam1146 commented 10 months ago

What I did.

This pull request introduces a new feature to the Goverter library: the -commentOnStruct flag. This feature allows users to add comments above generated structs, which can be especially useful when working with other code generation tools like Autowire.

Changes Made

I have introduced a new command-line flag, -commentOnStruct, which, when enabled, will add a comment above each generated struct. These comments can provide valuable information about the struct's purpose, source, or usage.

Example Usage

goverter -commentOnStruct "// @autowire(set=converter)" <otherFlag> <path>

result

// @autowire(set=converter)
type ConverterImpl struct{}