Skip to content

Commit 80dcbc8

Browse files
committed
Fix example test suites without result
generated by testing/codegen.
1 parent f95ea3a commit 80dcbc8

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

testing/codegen/templates/suite_test.go.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func Run{{ .Service.StructName }}Harness(t *testing.T, svc {{ .Service.PkgName }
1515
{{- range .NonStream }}
1616
{{- $m := . }}
1717
t.Run("{{ $m.Method.Name }}", func(t *testing.T) {
18-
result, err := h.Client.{{ $m.Method.VarName }}({{ if $.UseCtx }}ctx{{ else }}context.Background(){{ end }}{{- if $m.Method.PayloadEx }}, td.Valid{{ goify $m.Method.Name true }}Payload(){{ end }})
18+
{{ if $m.Method.ResultRef }}result, {{ end }}err := h.Client.{{ $m.Method.VarName }}({{ if $.UseCtx }}ctx{{ else }}context.Background(){{ end }}{{- if $m.Method.PayloadEx }}, td.Valid{{ goify $m.Method.Name true }}Payload(){{ end }})
1919
if err != nil {
2020
t.Errorf("{{ $m.Method.Name }} failed: %v", err)
2121
}

testing/codegen/testdata/code.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ func RunWithoutResultServiceHarness(t *testing.T, svc withoutresultservice.Servi
948948
949949
td := withoutResultServicetest.NewTestData()
950950
t.Run("WithoutResultMethod", func(t *testing.T) {
951-
result, err := h.Client.WithoutResultMethod(ctx)
951+
err := h.Client.WithoutResultMethod(ctx)
952952
if err != nil {
953953
t.Errorf("WithoutResultMethod failed: %v", err)
954954
}

0 commit comments

Comments
 (0)