fix
This commit is contained in:
parent
83854d36ad
commit
f539c8bf59
@ -21,13 +21,13 @@ func (g *TypescriptApiGenerator) Generate(api *Api, destFile string) error {
|
|||||||
Api: api,
|
Api: api,
|
||||||
}
|
}
|
||||||
|
|
||||||
tpl := template.New("gogen")
|
tpl := template.New("tsgen")
|
||||||
tpl = tpl.Funcs(map[string]any{
|
tpl = tpl.Funcs(map[string]any{
|
||||||
"typedef": func(t ValType) (string, error) {
|
"typedef": func(t ValType) (string, error) {
|
||||||
td, ok := map[ValType]string{
|
td, ok := map[ValType]string{
|
||||||
TInt: "number",
|
TInt: "number",
|
||||||
TString: "string",
|
TString: "string",
|
||||||
TBool: "bool",
|
TBool: "boolean",
|
||||||
}[t]
|
}[t]
|
||||||
if !ok {
|
if !ok {
|
||||||
return "", fmt.Errorf("cannot generate type %v", t)
|
return "", fmt.Errorf("cannot generate type %v", t)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user