Skip to content

Commit 6203590

Browse files
committed
remove redundant error return value
1 parent 9326206 commit 6203590

File tree

5 files changed

+15
-30
lines changed

5 files changed

+15
-30
lines changed

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ type (
255255
// - EntityNotExistsError
256256
// - BadRequestError
257257
// - InternalServiceError
258-
GetWorkflowHistoryWithOptions(ctx context.Context, request *GetWorkflowHistoryWithOptionsRequest) (HistoryEventIterator, error)
258+
GetWorkflowHistoryWithOptions(ctx context.Context, request *GetWorkflowHistoryWithOptionsRequest) HistoryEventIterator
259259

260260
// CompleteActivity reports activity completed.
261261
// activity Execute method can return activity.ErrResultPending to

internal/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ type (
226226
// - EntityNotExistsError
227227
// - BadRequestError
228228
// - InternalServiceError
229-
GetWorkflowHistoryWithOptions(ctx context.Context, request *GetWorkflowHistoryWithOptionsRequest) (HistoryEventIterator, error)
229+
GetWorkflowHistoryWithOptions(ctx context.Context, request *GetWorkflowHistoryWithOptionsRequest) HistoryEventIterator
230230

231231
// CompleteActivity reports activity completed.
232232
// activity Execute method can return acitivity.activity.ErrResultPending to

internal/internal_workflow_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ func (wc *workflowClient) GetWorkflowHistory(
480480
FilterType: filterType,
481481
QueryConsistencyLevel: QueryConsistencyLevelUnspecified,
482482
}
483-
iter, _ := wc.GetWorkflowHistoryWithOptions(ctx, request)
483+
iter := wc.GetWorkflowHistoryWithOptions(ctx, request)
484484
return iter
485485
}
486486

@@ -490,7 +490,7 @@ func (wc *workflowClient) GetWorkflowHistory(
490490
// - EntityNotExistsError
491491
// - BadRequestError
492492
// - InternalServiceError
493-
func (wc *workflowClient) GetWorkflowHistoryWithOptions(ctx context.Context, request *GetWorkflowHistoryWithOptionsRequest) (HistoryEventIterator, error) {
493+
func (wc *workflowClient) GetWorkflowHistoryWithOptions(ctx context.Context, request *GetWorkflowHistoryWithOptionsRequest) HistoryEventIterator {
494494
domain := wc.domain
495495
paginate := func(nextToken []byte) (*s.GetWorkflowExecutionHistoryResponse, error) {
496496
req := &s.GetWorkflowExecutionHistoryRequest{
@@ -567,7 +567,7 @@ func (wc *workflowClient) GetWorkflowHistoryWithOptions(ctx context.Context, req
567567

568568
return &historyEventIteratorImpl{
569569
paginate: paginate,
570-
}, nil
570+
}
571571
}
572572

573573
func isEntityNonExistFromPassive(err error) bool {

internal/internal_workflow_client_test.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,7 +2629,7 @@ func (s *workflowClientTestSuite) TestGetWorkflowHistoryWithOptions() {
26292629
requestValidator func(req *shared.GetWorkflowExecutionHistoryRequest)
26302630
rpcError error
26312631
response *shared.GetWorkflowExecutionHistoryResponse
2632-
responseValidator func(iter HistoryEventIterator, err error)
2632+
responseValidator func(iter HistoryEventIterator)
26332633
}{
26342634
{
26352635
name: "success without query consistency level",
@@ -2657,8 +2657,7 @@ func (s *workflowClientTestSuite) TestGetWorkflowHistoryWithOptions() {
26572657
},
26582658
NextPageToken: nil,
26592659
},
2660-
responseValidator: func(iter HistoryEventIterator, err error) {
2661-
s.NoError(err)
2660+
responseValidator: func(iter HistoryEventIterator) {
26622661
s.NotNil(iter)
26632662
s.True(iter.HasNext())
26642663
event, nextErr := iter.Next()
@@ -2693,8 +2692,7 @@ func (s *workflowClientTestSuite) TestGetWorkflowHistoryWithOptions() {
26932692
},
26942693
NextPageToken: nil,
26952694
},
2696-
responseValidator: func(iter HistoryEventIterator, err error) {
2697-
s.NoError(err)
2695+
responseValidator: func(iter HistoryEventIterator) {
26982696
s.NotNil(iter)
26992697
s.True(iter.HasNext())
27002698
event, nextErr := iter.Next()
@@ -2729,8 +2727,7 @@ func (s *workflowClientTestSuite) TestGetWorkflowHistoryWithOptions() {
27292727
},
27302728
NextPageToken: nil,
27312729
},
2732-
responseValidator: func(iter HistoryEventIterator, err error) {
2733-
s.NoError(err)
2730+
responseValidator: func(iter HistoryEventIterator) {
27342731
s.NotNil(iter)
27352732
s.True(iter.HasNext())
27362733
event, nextErr := iter.Next()
@@ -2768,8 +2765,7 @@ func (s *workflowClientTestSuite) TestGetWorkflowHistoryWithOptions() {
27682765
},
27692766
NextPageToken: nil,
27702767
},
2771-
responseValidator: func(iter HistoryEventIterator, err error) {
2772-
s.NoError(err)
2768+
responseValidator: func(iter HistoryEventIterator) {
27732769
s.NotNil(iter)
27742770

27752771
// Check that the iterator returns all events in order
@@ -2795,8 +2791,7 @@ func (s *workflowClientTestSuite) TestGetWorkflowHistoryWithOptions() {
27952791
requestValidator: func(req *shared.GetWorkflowExecutionHistoryRequest) {},
27962792
rpcError: &shared.AccessDeniedError{},
27972793
response: nil,
2798-
responseValidator: func(iter HistoryEventIterator, err error) {
2799-
s.NoError(err, "should not return error immediately")
2794+
responseValidator: func(iter HistoryEventIterator) {
28002795
s.NotNil(iter, "iterator should be returned")
28012796

28022797
// Error should be returned when iterator is used
@@ -2817,8 +2812,8 @@ func (s *workflowClientTestSuite) TestGetWorkflowHistoryWithOptions() {
28172812
}).
28182813
Return(tt.response, tt.rpcError)
28192814

2820-
iter, err := s.client.GetWorkflowHistoryWithOptions(context.Background(), tt.request)
2821-
tt.responseValidator(iter, err)
2815+
iter := s.client.GetWorkflowHistoryWithOptions(context.Background(), tt.request)
2816+
tt.responseValidator(iter)
28222817
})
28232818
}
28242819
}

mocks/Client.go

Lines changed: 2 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)