Skip to content

Commit dca3f7d

Browse files
authored
Upgrade go to 1.11 (cadence-workflow#589)
1 parent 190fa08 commit dca3f7d

8 files changed

+54
-54
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ language: go
55
directories:
66
- $HOME/.glide/cache
77
go:
8-
- 1.10.x
8+
- 1.11.x
99

1010
go_import_path: go.uber.org/cadence
1111
addons:

evictiontest/workflow_cache_eviction_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ func createTestEventWorkflowExecutionStarted(eventID int64, attr *m.WorkflowExec
105105

106106
func createTestEventDecisionTaskScheduled(eventID int64, attr *m.DecisionTaskScheduledEventAttributes) *m.HistoryEvent {
107107
return &m.HistoryEvent{
108-
EventId: common.Int64Ptr(eventID),
109-
EventType: common.EventTypePtr(m.EventTypeDecisionTaskScheduled),
108+
EventId: common.Int64Ptr(eventID),
109+
EventType: common.EventTypePtr(m.EventTypeDecisionTaskScheduled),
110110
DecisionTaskScheduledEventAttributes: attr}
111111
}
112112

internal/internal_task_handlers.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,14 @@ func newWorkflowTaskHandler(
310310
) WorkflowTaskHandler {
311311
ensureRequiredParams(&params)
312312
return &workflowTaskHandlerImpl{
313-
domain: domain,
314-
logger: params.Logger,
315-
ppMgr: ppMgr,
316-
metricsScope: metrics.NewTaggedScope(params.MetricsScope),
317-
identity: params.Identity,
318-
enableLoggingInReplay: params.EnableLoggingInReplay,
319-
disableStickyExecution: params.DisableStickyExecution,
320-
hostEnv: hostEnv,
313+
domain: domain,
314+
logger: params.Logger,
315+
ppMgr: ppMgr,
316+
metricsScope: metrics.NewTaggedScope(params.MetricsScope),
317+
identity: params.Identity,
318+
enableLoggingInReplay: params.EnableLoggingInReplay,
319+
disableStickyExecution: params.DisableStickyExecution,
320+
hostEnv: hostEnv,
321321
nonDeterministicWorkflowPolicy: params.NonDeterministicWorkflowPolicy,
322322
dataConverter: params.DataConverter,
323323
}
@@ -501,8 +501,8 @@ func (wth *workflowTaskHandlerImpl) createWorkflowContext(task *s.PollForDecisio
501501
},
502502
ExecutionStartToCloseTimeoutSeconds: attributes.GetExecutionStartToCloseTimeoutSeconds(),
503503
TaskStartToCloseTimeoutSeconds: attributes.GetTaskStartToCloseTimeoutSeconds(),
504-
Domain: wth.domain,
505-
Attempt: attributes.GetAttempt(),
504+
Domain: wth.domain,
505+
Attempt: attributes.GetAttempt(),
506506
}
507507

508508
wfStartTime := time.Unix(0, h.Events[0].GetTimestamp())
@@ -1246,9 +1246,9 @@ func (wth *workflowTaskHandlerImpl) completeWorkflow(
12461246
metricsScope.Counter(metrics.WorkflowContinueAsNewCounter).Inc(1)
12471247
closeDecision = createNewDecision(s.DecisionTypeContinueAsNewWorkflowExecution)
12481248
closeDecision.ContinueAsNewWorkflowExecutionDecisionAttributes = &s.ContinueAsNewWorkflowExecutionDecisionAttributes{
1249-
WorkflowType: workflowTypePtr(*contErr.params.workflowType),
1250-
Input: contErr.params.input,
1251-
TaskList: common.TaskListPtr(s.TaskList{Name: contErr.params.taskListName}),
1249+
WorkflowType: workflowTypePtr(*contErr.params.workflowType),
1250+
Input: contErr.params.input,
1251+
TaskList: common.TaskListPtr(s.TaskList{Name: contErr.params.taskListName}),
12521252
ExecutionStartToCloseTimeoutSeconds: contErr.params.executionStartToCloseTimeoutSeconds,
12531253
TaskStartToCloseTimeoutSeconds: contErr.params.taskStartToCloseTimeoutSeconds,
12541254
}

internal/internal_task_handlers_test.go

+14-14
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ func createTestEventWorkflowExecutionStarted(eventID int64, attr *s.WorkflowExec
8383

8484
func createTestEventActivityTaskScheduled(eventID int64, attr *s.ActivityTaskScheduledEventAttributes) *s.HistoryEvent {
8585
return &s.HistoryEvent{
86-
EventId: common.Int64Ptr(eventID),
87-
EventType: common.EventTypePtr(s.EventTypeActivityTaskScheduled),
86+
EventId: common.Int64Ptr(eventID),
87+
EventType: common.EventTypePtr(s.EventTypeActivityTaskScheduled),
8888
ActivityTaskScheduledEventAttributes: attr}
8989
}
9090

@@ -97,8 +97,8 @@ func createTestEventActivityTaskStarted(eventID int64, attr *s.ActivityTaskStart
9797

9898
func createTestEventActivityTaskCompleted(eventID int64, attr *s.ActivityTaskCompletedEventAttributes) *s.HistoryEvent {
9999
return &s.HistoryEvent{
100-
EventId: common.Int64Ptr(eventID),
101-
EventType: common.EventTypePtr(s.EventTypeActivityTaskCompleted),
100+
EventId: common.Int64Ptr(eventID),
101+
EventType: common.EventTypePtr(s.EventTypeActivityTaskCompleted),
102102
ActivityTaskCompletedEventAttributes: attr}
103103
}
104104

@@ -111,8 +111,8 @@ func createTestEventActivityTaskTimedOut(eventID int64, attr *s.ActivityTaskTime
111111

112112
func createTestEventDecisionTaskScheduled(eventID int64, attr *s.DecisionTaskScheduledEventAttributes) *s.HistoryEvent {
113113
return &s.HistoryEvent{
114-
EventId: common.Int64Ptr(eventID),
115-
EventType: common.EventTypePtr(s.EventTypeDecisionTaskScheduled),
114+
EventId: common.Int64Ptr(eventID),
115+
EventType: common.EventTypePtr(s.EventTypeDecisionTaskScheduled),
116116
DecisionTaskScheduledEventAttributes: attr}
117117
}
118118

@@ -135,8 +135,8 @@ func createTestEventWorkflowExecutionSignaled(eventID int64, signalName string)
135135

136136
func createTestEventDecisionTaskCompleted(eventID int64, attr *s.DecisionTaskCompletedEventAttributes) *s.HistoryEvent {
137137
return &s.HistoryEvent{
138-
EventId: common.Int64Ptr(eventID),
139-
EventType: common.EventTypePtr(s.EventTypeDecisionTaskCompleted),
138+
EventId: common.Int64Ptr(eventID),
139+
EventType: common.EventTypePtr(s.EventTypeDecisionTaskCompleted),
140140
DecisionTaskCompletedEventAttributes: attr}
141141
}
142142

@@ -383,9 +383,9 @@ func (t *TaskHandlersTestSuite) TestCacheEvictionWhenErrorOccurs() {
383383
}),
384384
}
385385
params := workerExecutionParameters{
386-
TaskList: taskList,
387-
Identity: "test-id-1",
388-
Logger: zap.NewNop(),
386+
TaskList: taskList,
387+
Identity: "test-id-1",
388+
Logger: zap.NewNop(),
389389
NonDeterministicWorkflowPolicy: NonDeterministicWorkflowPolicyBlockWorkflow,
390390
}
391391

@@ -421,9 +421,9 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicDetection() {
421421
}
422422
task := createWorkflowTask(testEvents, 3, "HelloWorld_Workflow")
423423
params := workerExecutionParameters{
424-
TaskList: taskList,
425-
Identity: "test-id-1",
426-
Logger: zap.NewNop(),
424+
TaskList: taskList,
425+
Identity: "test-id-1",
426+
Logger: zap.NewNop(),
427427
NonDeterministicWorkflowPolicy: NonDeterministicWorkflowPolicyBlockWorkflow,
428428
}
429429

internal/internal_worker_interfaces_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (s *InterfacesTestSuite) TestInterface() {
127127
workflowExecutionParameters := workerExecutionParameters{
128128
TaskList: "testTaskList",
129129
ConcurrentPollRoutineSize: 4,
130-
Logger: logger,
130+
Logger: logger,
131131
}
132132

133133
domainStatus := m.DomainStatusRegistered
@@ -156,7 +156,7 @@ func (s *InterfacesTestSuite) TestInterface() {
156156
activityExecutionParameters := workerExecutionParameters{
157157
TaskList: "testTaskList",
158158
ConcurrentPollRoutineSize: 10,
159-
Logger: logger,
159+
Logger: logger,
160160
}
161161

162162
// Register activity instances and launch the worker.

internal/internal_workers_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func (s *WorkersTestSuite) TestWorkflowWorker() {
7373
executionParameters := workerExecutionParameters{
7474
TaskList: "testTaskList",
7575
ConcurrentPollRoutineSize: 5,
76-
Logger: logger,
76+
Logger: logger,
7777
}
7878
overrides := &workerOverrides{workflowTaskHandler: newSampleWorkflowTaskHandler()}
7979
workflowWorker := newWorkflowWorkerInternal(
@@ -94,7 +94,7 @@ func (s *WorkersTestSuite) TestActivityWorker() {
9494
executionParameters := workerExecutionParameters{
9595
TaskList: "testTaskList",
9696
ConcurrentPollRoutineSize: 5,
97-
Logger: logger,
97+
Logger: logger,
9898
}
9999
overrides := &workerOverrides{activityTaskHandler: newSampleActivityTaskHandler()}
100100
a := &greeterActivity{}
@@ -116,7 +116,7 @@ func (s *WorkersTestSuite) TestPollForDecisionTask_InternalServiceError() {
116116
executionParameters := workerExecutionParameters{
117117
TaskList: "testDecisionTaskList",
118118
ConcurrentPollRoutineSize: 5,
119-
Logger: zap.NewNop(),
119+
Logger: zap.NewNop(),
120120
}
121121
overrides := &workerOverrides{workflowTaskHandler: newSampleWorkflowTaskHandler()}
122122
workflowWorker := newWorkflowWorkerInternal(
@@ -165,7 +165,7 @@ func (s *WorkersTestSuite) TestLongRunningDecisionTask() {
165165
EventId: common.Int64Ptr(1),
166166
EventType: common.EventTypePtr(m.EventTypeWorkflowExecutionStarted),
167167
WorkflowExecutionStartedEventAttributes: &m.WorkflowExecutionStartedEventAttributes{
168-
TaskList: &m.TaskList{Name: &taskList},
168+
TaskList: &m.TaskList{Name: &taskList},
169169
ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(10),
170170
TaskStartToCloseTimeoutSeconds: common.Int32Ptr(2),
171171
WorkflowType: &m.WorkflowType{Name: common.StringPtr("long-running-decision-workflow-type")},
@@ -178,8 +178,8 @@ func (s *WorkersTestSuite) TestLongRunningDecisionTask() {
178178
EventId: common.Int64Ptr(5),
179179
EventType: common.EventTypePtr(m.EventTypeMarkerRecorded),
180180
MarkerRecordedEventAttributes: &m.MarkerRecordedEventAttributes{
181-
MarkerName: common.StringPtr(localActivityMarkerName),
182-
Details: s.createLocalActivityMarkerDataForTest("0"),
181+
MarkerName: common.StringPtr(localActivityMarkerName),
182+
Details: s.createLocalActivityMarkerDataForTest("0"),
183183
DecisionTaskCompletedEventId: common.Int64Ptr(4),
184184
},
185185
},
@@ -190,8 +190,8 @@ func (s *WorkersTestSuite) TestLongRunningDecisionTask() {
190190
EventId: common.Int64Ptr(9),
191191
EventType: common.EventTypePtr(m.EventTypeMarkerRecorded),
192192
MarkerRecordedEventAttributes: &m.MarkerRecordedEventAttributes{
193-
MarkerName: common.StringPtr(localActivityMarkerName),
194-
Details: s.createLocalActivityMarkerDataForTest("1"),
193+
MarkerName: common.StringPtr(localActivityMarkerName),
194+
Details: s.createLocalActivityMarkerDataForTest("1"),
195195
DecisionTaskCompletedEventId: common.Int64Ptr(8),
196196
},
197197
},

internal/internal_workflow_client.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,12 @@ func (wc *workflowClient) StartWorkflow(
168168
}
169169

170170
startRequest := &s.StartWorkflowExecutionRequest{
171-
Domain: common.StringPtr(wc.domain),
172-
RequestId: common.StringPtr(uuid.New()),
173-
WorkflowId: common.StringPtr(workflowID),
174-
WorkflowType: workflowTypePtr(*workflowType),
175-
TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(options.TaskList)}),
176-
Input: input,
171+
Domain: common.StringPtr(wc.domain),
172+
RequestId: common.StringPtr(uuid.New()),
173+
WorkflowId: common.StringPtr(workflowID),
174+
WorkflowType: workflowTypePtr(*workflowType),
175+
TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(options.TaskList)}),
176+
Input: input,
177177
ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(executionTimeout),
178178
TaskStartToCloseTimeoutSeconds: common.Int32Ptr(decisionTaskTimeout),
179179
Identity: common.StringPtr(wc.identity),
@@ -317,12 +317,12 @@ func (wc *workflowClient) SignalWithStartWorkflow(ctx context.Context, workflowI
317317
}
318318

319319
signalWithStartRequest := &s.SignalWithStartWorkflowExecutionRequest{
320-
Domain: common.StringPtr(wc.domain),
321-
RequestId: common.StringPtr(uuid.New()),
322-
WorkflowId: common.StringPtr(workflowID),
323-
WorkflowType: workflowTypePtr(*workflowType),
324-
TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(options.TaskList)}),
325-
Input: input,
320+
Domain: common.StringPtr(wc.domain),
321+
RequestId: common.StringPtr(uuid.New()),
322+
WorkflowId: common.StringPtr(workflowID),
323+
WorkflowType: workflowTypePtr(*workflowType),
324+
TaskList: common.TaskListPtr(s.TaskList{Name: common.StringPtr(options.TaskList)}),
325+
Input: input,
326326
ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(executionTimeout),
327327
TaskStartToCloseTimeoutSeconds: common.Int32Ptr(decisionTaskTimeout),
328328
SignalName: common.StringPtr(signalName),

internal/internal_workflow_testsuite_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,7 @@ func (s *WorkflowTestSuiteUnitTest) Test_SignalChildWorkflow() {
14301430
workflowFn := func(ctx Context) error {
14311431
cwo := ChildWorkflowOptions{
14321432
ExecutionStartToCloseTimeout: time.Minute,
1433-
Domain: "test-domain",
1433+
Domain: "test-domain",
14341434
}
14351435
ctx = WithChildWorkflowOptions(ctx, cwo)
14361436
childFuture := ExecuteChildWorkflow(ctx, childWorkflowFn, GetWorkflowInfo(ctx).WorkflowExecution)
@@ -1547,7 +1547,7 @@ func (s *WorkflowTestSuiteUnitTest) Test_CancelChildWorkflow() {
15471547
workflowFn := func(ctx Context) error {
15481548

15491549
cwo := ChildWorkflowOptions{
1550-
Domain: "test-domain",
1550+
Domain: "test-domain",
15511551
ExecutionStartToCloseTimeout: time.Minute,
15521552
}
15531553

0 commit comments

Comments
 (0)