gobuffalo / genny

A framework for writing modular generators
MIT License
65 stars 14 forks source link

Attrs Parse and field uniqueness #4

Closed paganotoni closed 6 years ago

paganotoni commented 6 years ago

When calling

https://github.com/gobuffalo/genny/blob/9033ae798a5a8575a9a9f95bd3f0a2c16f8fa3c1/movinglater/attrs/parse.go#L33

It allows to have duplicated attributes, when using this to generate code usually the plugin will need to validate this.

I wonder if we should keep the first of the same name we receive there.

markbates commented 6 years ago

Perhaps return a “duplicate attr name” error?

Thanks.


Mark Bates On Sep 29, 2018, 1:42 PM -0400, Antonio Pagano notifications@github.com, wrote:

When calling https://github.com/gobuffalo/genny/blob/9033ae798a5a8575a9a9f95bd3f0a2c16f8fa3c1/movinglater/attrs/parse.go#L33 It allows to have duplicated attributes, when using this to generate code usually the plugin will need to validate this. I wonder if we should keep the first of the same name we receive there. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

paganotoni commented 6 years ago

Thats great, i'll go for it.

paganotoni commented 6 years ago

@markbates sent #6