Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwara committed May 20, 2024
1 parent dfe564e commit 660fde0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/aws-sdk-client-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ func {{ $.PkgName }}_{{ .Name }}(ctx context.Context, p *clientMethodParam) (any
if err := json.Unmarshal(p.InputBytes, &in); err != nil {
return nil, fmt.Errorf("failed to unmarshal request: %w", err)
}
{{- if .InputReaderField }}
if p.InputReader != nil {
{{- if .InputReaderField }}
in.{{ .InputReaderField }} = p.InputReader
}
{{- else }}
if p.InputReader != nil {
return nil, fmt.Errorf("{{ $.PkgName }}.{{ .Name }}Input has no io.Reader field")
}
return nil, fmt.Errorf("{{ $.PkgName }}.{{ .Name }}Input has no io.Reader field")
{{- end }}
}
return svc.{{ .Name }}(ctx, &in)
}
Expand Down

0 comments on commit 660fde0

Please sign in to comment.