-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Hi,
Thanks for making this awesome tool! I have a feature request for the conversion from TS to Go. I wonder if it makes sense to add an option not to convert TS optional fields to Go pointer types.
I make this request because Go already treats all struct fields optional and drops empty with omitempty tag in JSON serialization.
For example
TS:
class Contact {
firstName: string;
lastName?: string;
}
Current state on converting to Go:
type Contact struct {
FirstName string `json:"firstName"`
LastName *string `json:"lastName,omitempty"`
}
Proposed change:
type Contact struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName,omitempty"`
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels