struct2ts icon indicating copy to clipboard operation
struct2ts copied to clipboard

Anything that is not `-` or `date` should be use as type for interfaces

Open shackra opened this issue 4 years ago • 0 comments

As stated.

Something like:

type Custom struct {
    MyValue `ts:"MyCustomType"`
}

Should become:

interface Custom {
    my_value: MyCustomType
}

For importing the types, I use a script with something like echo "import {Type} from '@types'" > src/types/golang.ts before running struct2ts, if someone is wondering.

shackra avatar May 18 '20 23:05 shackra