Skip to content

Commit

Permalink
fix: fix no throw generated when function resp is void (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeyJavaBean committed Feb 21, 2024
1 parent 8d9701e commit 4302468
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions generator/golang/templates/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ func (p *{{$ClientName}}) {{- template "FunctionSignature" . -}} {
if err = p.Client_().Call(ctx, "{{.Name}}", &_args, &_result); err != nil {
return
}
{{- if .Throws}}
switch {
{{- range .Throws}}
case _result.{{($ResType.Field .Name).GoName}} != nil:
return _result.{{($ResType.Field .Name).GoName}}
{{- end}}
}
{{- end}}
{{- end}}
return nil
{{- else}}{{/* If .Void */}}
Expand Down

0 comments on commit 4302468

Please sign in to comment.