tons of code

This commit is contained in:
Egor Aristov 2025-10-26 14:26:02 +03:00
parent 8be9d454d5
commit 57835e81ac
Signed by: egor3f
GPG Key ID: 40482A264AAEC85F
2 changed files with 7 additions and 7 deletions

View File

@ -46,11 +46,11 @@ func (g *GoApiParser) Parse(sourceFile string) (*api.Api, error) {
continue continue
} }
structType, ok := typeSpec.Type.(*ast.StructType) _, isStruct := typeSpec.Type.(*ast.StructType)
if !ok { _, isIface := typeSpec.Type.(*ast.InterfaceType)
if !isStruct && !isIface {
continue continue
} }
_ = structType
apis.Endpoints = append(apis.Endpoints, api.Endpoint{ apis.Endpoints = append(apis.Endpoints, api.Endpoint{
Name: typeSpec.Name.Name, Name: typeSpec.Name.Name,
@ -96,8 +96,8 @@ func (g *GoApiParser) Parse(sourceFile string) (*api.Api, error) {
var apiPar api.Val var apiPar api.Val
ident := param.Type.(*ast.Ident) ident := param.Type.(*ast.Ident)
switch ident.Name { switch ident.Name {
case "int": //case "int":
apiPar.Type = api.TInt // apiPar.Type = api.TInt
case "string": case "string":
apiPar.Type = api.TString apiPar.Type = api.TString
case "bool": case "bool":

View File

@ -107,8 +107,8 @@ func (t *TypescriptApiParser) Parse(sourceFilePath string) (*api.Api, error) {
if method.Type != nil { if method.Type != nil {
var apiRet api.Val var apiRet api.Val
switch method.Type.Kind { switch method.Type.Kind {
case ast.KindNumberKeyword: //case ast.KindNumberKeyword:
apiRet.Type = api.TInt // apiRet.Type = api.TInt
case ast.KindStringKeyword: case ast.KindStringKeyword:
apiRet.Type = api.TString apiRet.Type = api.TString
case ast.KindBooleanKeyword: case ast.KindBooleanKeyword: