This extension is built based on JSON to GO
Wake up the command palletet and input json2go
for json convert or sql2go
for sql convert
You can choose the input source of the JSON/SQL data.
If setting is <ask me every time>, you will be asked on every run of the command.
Also you will be asked to remember your choice, unless you select `No and don't ask again' in which case you will never be asked again to save your choice.
You can choose inside which languages to show the context menu with the following setting.
Include "*"
if you want the context menu to always be shown.
Default values are below.
"json2go.contextMenu.supportedLanguages": [
"javascript",
"typescript",
"json",
"jsonc",
"html",
"go"
]
The checkbox allows you to generate nested types as inline structs:
type Autogenerated struct {
Employees []struct {
Name string `json:"name"`
Email string `json:"email"`
} `json:"employees"`
}
Or below the main struct:
type Autogenerated struct {
Employees []Employee `json:"employees"`
}
type Employee struct {
Name string `json:"name"`
Email string `json:"email"`
}
//choose tags which you like to add, "gorm" is supported automatically
"sql2gorm.tags":["json","form","mapstructure"]