You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One more level of dereferencing is required when the type is slice so as to handle the type like Slice of Pointers better.
Currently, the tool is not creating the correct display type for api fields of type slice of pointers, that is - []*Type. The reference spec is here for the types defined here
The display type of []*GCPDisks should have ideally shown up as either []*GCPDisks (for developer persona) or []GCPDisks (for operator persona) instead of []*github.com/gardener/machine-controller-manager-provider-gcp/pkg/gcp/apis/v1.GCPDisk.
In the main.gohere, if the type is a Slice & specifically Slice of Pointers (i.e, Type.Elem.Kind is Pointer), then we have to add another deferencing on t.Elem and return the pointer name.
The text was updated successfully, but these errors were encountered:
I faced this issue with my project related types which has one level deferencing of type []*Type.
However, there can be a scenario of any level of pointers. For example - []**Type or []***Type or []****Type. So, I have now proposed in PR #37 a generic solution which renders the typeDisplayName of the type for any levels of pointers when the type is Slice of Pointers :)
AxiomSamarth
changed the title
One more level of deferencing required when the type is Slice
The typeDisplayName (rendered name of Type) is not correct when it is of type Slice of Pointers
Jun 4, 2021
AxiomSamarth
changed the title
The typeDisplayName (rendered name of Type) is not correct when it is of type Slice of Pointers
The typeDisplayName (rendered name of Type) is not correct when it is of type *Slice of Pointers*
Jun 4, 2021
AxiomSamarth
changed the title
The typeDisplayName (rendered name of Type) is not correct when it is of type *Slice of Pointers*
The typeDisplayName (rendered name of Type) is not correct when it is of type Slice of Pointers
Jun 4, 2021
One more level of dereferencing is required when the type is slice so as to handle the type like Slice of Pointers better.
Currently, the tool is not creating the correct display type for api fields of type slice of pointers, that is -
[]*Type
. The reference spec is here for the types defined hereThe display type of
[]*GCPDisks
should have ideally shown up as either[]*GCPDisks
(for developer persona) or[]GCPDisks
(for operator persona) instead of[]*github.com/gardener/machine-controller-manager-provider-gcp/pkg/gcp/apis/v1.GCPDisk
.In the
main.go
here, if the type is a Slice & specifically Slice of Pointers (i.e,Type.Elem.Kind
is Pointer), then we have to add another deferencing ont.Elem
and return the pointer name.The text was updated successfully, but these errors were encountered: