tkrajina / typescriptify-golang-structs

A Golang struct to TypeScript class/interface converter
Apache License 2.0
505 stars 87 forks source link

We should have `MyType | undefined` for fields with a type pointer #29

Closed shackra closed 3 years ago

shackra commented 3 years ago

I have a struct which have a field pointer:

type Test struct {
    Field *string
}

However, the resulting conversion appears as follows:

export interface Test {
    field: string
}

Ideally, we should have something like field?: string instead.