goformation icon indicating copy to clipboard operation
goformation copied to clipboard

Do not use *interface{}

Open xrn opened this issue 2 years ago • 2 comments

SQS example:

RedrivePolicy *interface{} `json:"RedrivePolicy,omitempty"`

I think should be

RedrivePolicy interface{} `json:"RedrivePolicy,omitempty"`

Probably this line is making a problem

{{$prop_name}} {{if (or ($property.IsPolymorphic) ($property.IsCustomType) (not ($property.Required)) )}}*{{end}}{{$property.GoType $.Name $.Basename $name}} `json:"{{$name}}{{if (not ($property.Required))}},omitempty{{end}}"`

And should be improved

xrn avatar Jul 11 '22 13:07 xrn

@rubenfonseca what do you think about this?

xrn avatar Jul 21 '22 13:07 xrn

Hi @xrn, thanks for the ping. We are currently on summer holidays and unfortunately we don't have the bandwidth in the team to fix this. You can wait a couple of weeks, or submit a PR to fix it if you have the time. We appreciate your understanding!

rubenfonseca avatar Jul 21 '22 14:07 rubenfonseca

@rubenfonseca tbh I am not sure how to write if which do not adds * for interface{}. Is there an option that you will support? Even if you can write an example here then I can prepare PR for it.

xrn avatar Aug 19 '22 13:08 xrn

Hi all, we've pushed a fix to 6.8.0 that should remove all pointers to interfaces! Thanks for your comments and feedback.

rubenfonseca avatar Sep 02 '22 09:09 rubenfonseca