diff --git a/Makefile b/Makefile index ec265346b30..76fb5bf5e70 100644 --- a/Makefile +++ b/Makefile @@ -361,6 +361,13 @@ $(BUILD)/gomod-lint: go.mod internal/tools/go.mod common/archiver/gcloud/go.mod $(BUILD)/code-lint: $(LINT_SRC) $(BIN)/revive | $(BUILD) $Q echo "lint..." $Q $(BIN)/revive -config revive.toml -exclude './vendor/...' -exclude './.gen/...' -formatter stylish ./... + $Q # look for go files with "//comments", and ignore "//go:build"-style directives ("grep -n" shows "file:line: //go:build" so the regex is a bit complex) + $Q bad="$$(find . -type f -name '*.go' -not -path './idls/*' | xargs grep -n -E '^\s*//\S' | grep -E -v '^[^:]+:[^:]+:\s*//[a-z]+:[a-z]+' || true)"; \ + if [ -n "$$bad" ]; then \ + echo "$$bad" >&2; \ + echo 'non-directive comments must have a space after the "//"' >&2; \ + exit 1; \ + fi $Q touch $@ # fmt and copyright are mutually cyclic with their inputs, so if a copyright header is modified: diff --git a/canary/config.go b/canary/config.go index d97777dd884..f777d070edf 100644 --- a/canary/config.go +++ b/canary/config.go @@ -76,7 +76,7 @@ type ( // Cron contains configuration for the cron workflow for canary Cron struct { CronSchedule string `yaml:"cronSchedule"` // default to "@every 30s" - CronExecutionTimeout time.Duration `yaml:"cronExecutionTimeout"` //default to 18 minutes + CronExecutionTimeout time.Duration `yaml:"cronExecutionTimeout"` // default to 18 minutes StartJobTimeout time.Duration `yaml:"startJobTimeout"` // default to 9 minutes } diff --git a/common/archiver/s3store/historyArchiver_test.go b/common/archiver/s3store/historyArchiver_test.go index ee1984ee28f..07225cfbbf9 100644 --- a/common/archiver/s3store/historyArchiver_test.go +++ b/common/archiver/s3store/historyArchiver_test.go @@ -657,8 +657,8 @@ func (s *historyArchiverSuite) TestArchiveAndGet() { } func (s *historyArchiverSuite) newTestHistoryArchiver(historyIterator archiver.HistoryIterator) *historyArchiver { - //config := &config.S3Archiver{} - //archiver, err := newHistoryArchiver(s.container, config, historyIterator) + // config := &config.S3Archiver{} + // archiver, err := newHistoryArchiver(s.container, config, historyIterator) archiver := &historyArchiver{ container: s.container, s3cli: s.s3cli, diff --git a/common/backoff/retrypolicy_test.go b/common/backoff/retrypolicy_test.go index c936fea0ed1..857eee2a983 100644 --- a/common/backoff/retrypolicy_test.go +++ b/common/backoff/retrypolicy_test.go @@ -188,7 +188,7 @@ func (s *RetryPolicySuite) TestNoMaxAttempts() { r, clock := createRetrier(policy) for i := 0; i < 100; i++ { next := r.NextBackOff() - //print("Iter: ", i, ", Next Backoff: ", next.String(), "\n") + // print("Iter: ", i, ", Next Backoff: ", next.String(), "\n") s.True(next > 0 || next == done, "Unexpected value for next retry duration: %v", next) clock.moveClock(next) } @@ -200,7 +200,7 @@ func (s *RetryPolicySuite) TestUnbounded() { r, clock := createRetrier(policy) for i := 0; i < 100; i++ { next := r.NextBackOff() - //print("Iter: ", i, ", Next Backoff: ", next.String(), "\n") + // print("Iter: ", i, ", Next Backoff: ", next.String(), "\n") s.True(next > 0 || next == done, "Unexpected value for next retry duration: %v", next) clock.moveClock(next) } diff --git a/common/config/metrics.go b/common/config/metrics.go index 75a1035b36b..7d44b5efb95 100644 --- a/common/config/metrics.go +++ b/common/config/metrics.go @@ -126,7 +126,7 @@ func (c *Metrics) newStatsdScope(logger log.Logger) tally.Scope { if err != nil { logger.Fatal("error creating statsd client", tag.Error(err)) } - //NOTE: according to ( https://github.com/uber-go/tally )Tally's statsd implementation doesn't support tagging. + // NOTE: according to ( https://github.com/uber-go/tally )Tally's statsd implementation doesn't support tagging. // Therefore, we implement Tally interface to have a statsd reporter that can support tagging reporter := statsdreporter.NewReporter(statter, tallystatsdreporter.Options{}) scopeOpts := tally.ScopeOptions{ diff --git a/common/config/tls.go b/common/config/tls.go index 3a276377b3c..dcac7e09f81 100644 --- a/common/config/tls.go +++ b/common/config/tls.go @@ -42,7 +42,7 @@ type ( CertFile string `yaml:"certFile"` KeyFile string `yaml:"keyFile"` - CaFile string `yaml:"caFile"` //optional depending on server config + CaFile string `yaml:"caFile"` // optional depending on server config CaFiles []string `yaml:"caFiles"` // If you want to verify the hostname and server cert (like a wildcard for cass cluster) then you should turn this on // This option is basically the inverse of InSecureSkipVerify diff --git a/common/domain/replication_queue.go b/common/domain/replication_queue.go index 897cad02153..62525b0f249 100644 --- a/common/domain/replication_queue.go +++ b/common/domain/replication_queue.go @@ -208,7 +208,7 @@ func (q *replicationQueueImpl) GetMessagesFromDLQ( return nil, nil, fmt.Errorf("failed to decode dlq task: %v", err) } - //Overwrite to local cluster message id + // Overwrite to local cluster message id replicationTask.SourceTaskId = common.Int64Ptr(int64(message.ID)) replicationTasks = append(replicationTasks, thrift.ToReplicationTask(&replicationTask)) } diff --git a/common/dynamicconfig/configstore/config/config.go b/common/dynamicconfig/configstore/config/config.go index 0b90816913f..b5081083143 100644 --- a/common/dynamicconfig/configstore/config/config.go +++ b/common/dynamicconfig/configstore/config/config.go @@ -22,8 +22,8 @@ package config import "time" -//This package is necessary to avoid import cycle as config_store_client imports common/config -//while common/config imports this ClientConfig definition +// This package is necessary to avoid import cycle as config_store_client imports common/config +// while common/config imports this ClientConfig definition // ClientConfig is the config for the config store based dynamic config client. // It specifies how often the cached config should be updated by checking underlying database. diff --git a/common/dynamicconfig/constants_test.go b/common/dynamicconfig/constants_test.go index 7b13658d11d..5262671d4e8 100644 --- a/common/dynamicconfig/constants_test.go +++ b/common/dynamicconfig/constants_test.go @@ -40,7 +40,7 @@ func TestConstantSuite(t *testing.T) { } func (s *constantSuite) TestListAllProductionKeys() { - //check if we given enough capacity + // check if we given enough capacity testResult := ListAllProductionKeys() s.GreaterOrEqual(len(IntKeys)+len(BoolKeys)+len(FloatKeys)+len(StringKeys)+len(DurationKeys)+len(MapKeys), len(testResult)) s.Equal(TestGetIntPropertyFilteredByTaskListInfoKey+1, testResult[0]) diff --git a/common/elasticsearch/client/v6/client_bulk.go b/common/elasticsearch/client/v6/client_bulk.go index 432b5400fe2..d9e1fce4830 100644 --- a/common/elasticsearch/client/v6/client_bulk.go +++ b/common/elasticsearch/client/v6/client_bulk.go @@ -80,8 +80,8 @@ func (v *v6BulkProcessor) Add(request *bulk.GenericBulkableAddRequest) { Version(request.Version). Doc(request.Doc) case bulk.BulkableCreateRequest: - //for bulk create request still calls the bulk index method - //with providing operation type + // for bulk create request still calls the bulk index method + // with providing operation type req = elastic.NewBulkIndexRequest(). OpType("create"). Index(request.Index). diff --git a/common/elasticsearch/client/v7/client_bulk.go b/common/elasticsearch/client/v7/client_bulk.go index 26c20dee22c..fd59518e8fc 100644 --- a/common/elasticsearch/client/v7/client_bulk.go +++ b/common/elasticsearch/client/v7/client_bulk.go @@ -76,8 +76,8 @@ func (v *v7BulkProcessor) Add(request *bulk.GenericBulkableAddRequest) { Version(request.Version). Doc(request.Doc) case bulk.BulkableCreateRequest: - //for bulk create request still calls the bulk index method - //with providing operation type + // for bulk create request still calls the bulk index method + // with providing operation type req = elastic.NewBulkIndexRequest(). OpType("create"). Index(request.Index). diff --git a/common/elasticsearch/esql/cadencesql.go b/common/elasticsearch/esql/cadencesql.go index 31019d329a7..7fab7075907 100644 --- a/common/elasticsearch/esql/cadencesql.go +++ b/common/elasticsearch/esql/cadencesql.go @@ -63,7 +63,7 @@ func (e *ESql) ConvertCadence(sql string, domainID string, pagination ...interfa return "", nil, err } - //sql valid, start to handle + // sql valid, start to handle switch stmt := stmt.(type) { case *sqlparser.Select: dsl, sortFields, err = e.convertSelect(*(stmt), domainID, pagination...) diff --git a/common/elasticsearch/esql/esql.go b/common/elasticsearch/esql/esql.go index ce81b63e16a..158e620c462 100644 --- a/common/elasticsearch/esql/esql.go +++ b/common/elasticsearch/esql/esql.go @@ -136,7 +136,7 @@ func (e *ESql) Convert(sql string, pagination ...interface{}) (dsl string, sortF return "", nil, err } - //sql valid, start to handle + // sql valid, start to handle switch stmt := stmt.(type) { case *sqlparser.Select: dsl, sortField, err = e.convertSelect(*(stmt), "", pagination...) diff --git a/common/log/tag/interface.go b/common/log/tag/interface.go index dbd1ab7ed71..5509c36ca64 100644 --- a/common/log/tag/interface.go +++ b/common/log/tag/interface.go @@ -69,7 +69,7 @@ func newBoolTag(key string, value bool) Tag { } func newErrorTag(key string, value error) Tag { - //NOTE zap already chosen "error" as key + // NOTE zap already chosen "error" as key return Tag{ field: zap.Error(value), } diff --git a/common/log/tag/tags.go b/common/log/tag/tags.go index 274a66f821e..2b00c54ba18 100644 --- a/common/log/tag/tags.go +++ b/common/log/tag/tags.go @@ -34,7 +34,7 @@ import ( // 1. Workflow: these tags are information that are useful to our customer, like workflow-id/run-id/task-list/... // 2. System : these tags are internal information which usually cannot be understood by our customers, -/////////////////// Common tags defined here /////////////////// +// ///////////////// Common tags defined here /////////////////// // Error returns tag for Error func Error(err error) Tag { @@ -59,7 +59,7 @@ func LatestTime(time int64) Tag { return newInt64("latest-time", time) } -/////////////////// Workflow tags defined here: ( wf is short for workflow) /////////////////// +// ///////////////// Workflow tags defined here: ( wf is short for workflow) /////////////////// // WorkflowAction returns tag for WorkflowAction func workflowAction(action string) Tag { @@ -342,7 +342,7 @@ func WorkflowEventType(eventType string) Tag { return newStringTag("wf-event-type", eventType) } -/////////////////// System tags defined here: /////////////////// +// ///////////////// System tags defined here: /////////////////// // Tags with pre-define values // component returns tag for component @@ -753,7 +753,7 @@ func TokenLastEventID(id int64) Tag { return newInt64("token-last-event-id", id) } -/////////////////// XDC tags defined here: xdc- /////////////////// +// ///////////////// XDC tags defined here: xdc- /////////////////// // SourceCluster returns tag for SourceCluster func SourceCluster(sourceCluster string) Tag { @@ -824,7 +824,7 @@ func ResponseMaxSize(size int) Tag { return newInt("response-max-size", size) } -/////////////////// Archival tags defined here: archival- /////////////////// +// ///////////////// Archival tags defined here: archival- /////////////////// // archival request tags // ArchivalCallerServiceName returns tag for the service name calling archival client diff --git a/common/membership/resolver.go b/common/membership/resolver.go index f4d5906c0a1..8afb0347d55 100644 --- a/common/membership/resolver.go +++ b/common/membership/resolver.go @@ -54,7 +54,7 @@ type ( // EvictSelf evicts this member from the membership ring. After this method is // called, other members should discover that this node is no longer part of the // ring. - //This primitive is useful to carry out graceful host shutdown during deployments. + // This primitive is useful to carry out graceful host shutdown during deployments. EvictSelf() error // Lookup will return host which is an owner for provided key. diff --git a/common/messaging/kafka/partition_ack_manager.go b/common/messaging/kafka/partition_ack_manager.go index 84d91f95dc9..6b66e6be855 100644 --- a/common/messaging/kafka/partition_ack_manager.go +++ b/common/messaging/kafka/partition_ack_manager.go @@ -34,7 +34,7 @@ import ( // assuming reading messages is in order and continuous(no skipping) type partitionAckManager struct { sync.RWMutex - ackMgrs map[int32]messaging.AckManager //map from partition to its ackManager + ackMgrs map[int32]messaging.AckManager // map from partition to its ackManager scopes map[int32]metrics.Scope // map from partition to its Scope metricsClient metrics.Client diff --git a/common/metrics/client.go b/common/metrics/client.go index dccad445eb8..4485cb7b71c 100644 --- a/common/metrics/client.go +++ b/common/metrics/client.go @@ -28,7 +28,7 @@ import ( // ClientImpl is used for reporting metrics by various Cadence services type ClientImpl struct { - //parentReporter is the parent scope for the metrics + // parentReporter is the parent scope for the metrics parentScope tally.Scope childScopes map[int]tally.Scope metricDefs map[int]metricDefinition diff --git a/common/metrics/defs.go b/common/metrics/defs.go index 3825f424d47..a068ba29806 100644 --- a/common/metrics/defs.go +++ b/common/metrics/defs.go @@ -36,7 +36,6 @@ type ( // metricDefinition contains the definition for a metric metricDefinition struct { - //nolint metricType MetricType // metric type metricName MetricName // metric name metricRollupName MetricName // optional. if non-empty, this name must be used for rolled-up version of this metric diff --git a/common/metrics/tally/statsd/reporter.go b/common/metrics/tally/statsd/reporter.go index a0b34a593fc..d4203641007 100644 --- a/common/metrics/tally/statsd/reporter.go +++ b/common/metrics/tally/statsd/reporter.go @@ -31,7 +31,7 @@ import ( ) type cadenceTallyStatsdReporter struct { - //Wrapper on top of "github.com/uber-go/tally/statsd" + // Wrapper on top of "github.com/uber-go/tally/statsd" tallystatsd tally.StatsReporter } diff --git a/common/metrics/tally/statsd/reporter_test.go b/common/metrics/tally/statsd/reporter_test.go index d0ee70e7816..a9bff58e7c1 100644 --- a/common/metrics/tally/statsd/reporter_test.go +++ b/common/metrics/tally/statsd/reporter_test.go @@ -51,7 +51,7 @@ func TestMetricNameWithTagsStability(t *testing.T) { } name := "test-metric-name2" - //test the order is stable + // test the order is stable for i := 1; i <= 16; i++ { assert.Equal(t, r.metricNameWithTags(name, tags), r.metricNameWithTags(name, tags)) } diff --git a/common/peerprovider/ringpopprovider/config_test.go b/common/peerprovider/ringpopprovider/config_test.go index 33de7791890..9dd0e6779c7 100644 --- a/common/peerprovider/ringpopprovider/config_test.go +++ b/common/peerprovider/ringpopprovider/config_test.go @@ -220,22 +220,22 @@ func (s *RingpopSuite) TestDNSSRVMode() { "duplicate entries should be removed", ) - //Expect unknown-duplicate.example.net to not resolve + // Expect unknown-duplicate.example.net to not resolve _, err = cfg.DiscoveryProvider.Hosts() s.NotNil(err) - //Remove known bad hosts from Unresolved list + // Remove known bad hosts from Unresolved list provider.UnresolvedHosts = []string{ "service-a.example.net", "service-b.example.net", "badhostport", } - //Expect badhostport to not seperate service name + // Expect badhostport to not seperate service name _, err = cfg.DiscoveryProvider.Hosts() s.NotNil(err) - //Remove known bad hosts from Unresolved list + // Remove known bad hosts from Unresolved list provider.UnresolvedHosts = []string{ "service-a.example.net", "service-b.example.net", diff --git a/common/persistence/dataStoreInterfaces.go b/common/persistence/dataStoreInterfaces.go index 4bc15efbb84..1f4dde17e5e 100644 --- a/common/persistence/dataStoreInterfaces.go +++ b/common/persistence/dataStoreInterfaces.go @@ -33,12 +33,12 @@ import ( ) type ( - ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// // Persistence interface is a lower layer of dataInterface. // The intention is to let different persistence implementation(SQL,Cassandra/etc) share some common logic // Right now the only common part is serialization/deserialization, and only ExecutionManager/HistoryManager need it. // TaskManager are the same. - ////////////////////////////////////////////////////////////////////// + // //////////////////////////////////////////////////////////////////// // ShardStore is the lower level of ShardManager ShardStore interface { @@ -95,7 +95,7 @@ type ( Closeable GetName() string GetShardID() int - //The below three APIs are related to serialization/deserialization + // The below three APIs are related to serialization/deserialization GetWorkflowExecution(ctx context.Context, request *InternalGetWorkflowExecutionRequest) (*InternalGetWorkflowExecutionResponse, error) UpdateWorkflowExecution(ctx context.Context, request *InternalUpdateWorkflowExecutionRequest) error ConflictResolveWorkflowExecution(ctx context.Context, request *InternalConflictResolveWorkflowExecutionRequest) error diff --git a/common/persistence/data_manager_interfaces.go b/common/persistence/data_manager_interfaces.go index 4a795a81788..d9a2e395df4 100644 --- a/common/persistence/data_manager_interfaces.go +++ b/common/persistence/data_manager_interfaces.go @@ -1162,7 +1162,7 @@ type ( TaskID int64 } - //RangeDeleteReplicationTaskFromDLQRequest is used to delete replication tasks from DLQ + // RangeDeleteReplicationTaskFromDLQRequest is used to delete replication tasks from DLQ RangeDeleteReplicationTaskFromDLQRequest struct { SourceClusterName string ExclusiveBeginTaskID int64 @@ -1170,7 +1170,7 @@ type ( PageSize int } - //RangeDeleteReplicationTaskFromDLQResponse is the response of RangeDeleteReplicationTaskFromDLQ + // RangeDeleteReplicationTaskFromDLQResponse is the response of RangeDeleteReplicationTaskFromDLQ RangeDeleteReplicationTaskFromDLQResponse struct { TasksCompleted int } @@ -1535,7 +1535,7 @@ type ( // The shard to get history node data ShardID *int - //DomainName to get metrics created with the domain + // DomainName to get metrics created with the domain DomainName string } @@ -1616,7 +1616,7 @@ type ( Info string // The shard to get history branch data ShardID *int - //DomainName to create metrics for Domain Cost Attribution + // DomainName to create metrics for Domain Cost Attribution DomainName string } @@ -1642,7 +1642,7 @@ type ( BranchToken []byte // The shard to delete history branch data ShardID *int - //DomainName to generate metrics for Domain Cost Attribution + // DomainName to generate metrics for Domain Cost Attribution DomainName string } @@ -1654,7 +1654,7 @@ type ( ShardID *int // optional: can provide treeID via branchToken if treeID is empty BranchToken []byte - //DomainName to create metrics + // DomainName to create metrics DomainName string } @@ -1863,7 +1863,7 @@ type ( Closeable FetchDynamicConfig(ctx context.Context, cfgType ConfigType) (*FetchDynamicConfigResponse, error) UpdateDynamicConfig(ctx context.Context, request *UpdateDynamicConfigRequest, cfgType ConfigType) error - //can add functions for config types other than dynamic config + // can add functions for config types other than dynamic config } ) diff --git a/common/persistence/elasticsearch/es_visibility_store.go b/common/persistence/elasticsearch/es_visibility_store.go index ee3a892c49c..0b9a99c05c0 100644 --- a/common/persistence/elasticsearch/es_visibility_store.go +++ b/common/persistence/elasticsearch/es_visibility_store.go @@ -503,7 +503,7 @@ const ( jsonRangeOnExecutionTime = `{"range":{"ExecutionTime":` jsonSortForOpen = `[{"StartTime":"desc"},{"RunID":"desc"}]` jsonSortWithTieBreaker = `{"RunID":"desc"}` - jsonMissingStartTime = `{"missing":{"field":"StartTime"}}` //used to identify uninitialized workflow execution records + jsonMissingStartTime = `{"missing":{"field":"StartTime"}}` // used to identify uninitialized workflow execution records dslFieldSort = "sort" dslFieldSearchAfter = "search_after" diff --git a/common/persistence/elasticsearch/es_visibility_store_test.go b/common/persistence/elasticsearch/es_visibility_store_test.go index 7d971e37a22..6fd5150aaf0 100644 --- a/common/persistence/elasticsearch/es_visibility_store_test.go +++ b/common/persistence/elasticsearch/es_visibility_store_test.go @@ -556,7 +556,7 @@ func (s *ESVisibilitySuite) TestSerializePageToken() { } // Move to client_v6_test -//func (s *ESVisibilitySuite) TestConvertSearchResultToVisibilityRecord() { +// func (s *ESVisibilitySuite) TestConvertSearchResultToVisibilityRecord() { // data := []byte(`{"CloseStatus": 0, // "CloseTime": 1547596872817380000, // "DomainID": "bfd5c907-f899-4baf-a7b2-2ab85e623ebd", @@ -598,7 +598,7 @@ func (s *ESVisibilitySuite) TestSerializePageToken() { // } // info = s.visibilityStore.convertSearchResultToVisibilityRecord(searchHit) // s.Nil(info) -//} +// } func (s *ESVisibilitySuite) TestShouldSearchAfter() { token := &es.ElasticVisibilityPageToken{} diff --git a/common/persistence/nosql/nosql_execution_store_util.go b/common/persistence/nosql/nosql_execution_store_util.go index 59c78c4fcc8..1759bfec1f1 100644 --- a/common/persistence/nosql/nosql_execution_store_util.go +++ b/common/persistence/nosql/nosql_execution_store_util.go @@ -88,7 +88,7 @@ func (d *nosqlExecutionStore) prepareResetWorkflowExecutionRequestWithMapsAndEve if err != nil { return nil, err } - //reset 6 maps + // reset 6 maps executionRequest.ActivityInfos, err = d.prepareActivityInfosForWorkflowTxn(resetWorkflow.ActivityInfos) if err != nil { return nil, err diff --git a/common/persistence/nosql/nosql_visibility_store.go b/common/persistence/nosql/nosql_visibility_store.go index 7e7be93bc0a..78df3bc85de 100644 --- a/common/persistence/nosql/nosql_visibility_store.go +++ b/common/persistence/nosql/nosql_visibility_store.go @@ -112,7 +112,7 @@ func (v *nosqlVisibilityStore) RecordWorkflowExecutionClosed( TaskList: request.TaskList, IsCron: request.IsCron, NumClusters: request.NumClusters, - //closed workflow attributes + // closed workflow attributes Status: &request.Status, CloseTime: request.CloseTimestamp, HistoryLength: request.HistoryLength, diff --git a/common/persistence/nosql/nosqlplugin/cassandra/visibility_cql.go b/common/persistence/nosql/nosqlplugin/cassandra/visibility_cql.go index d618a792a9b..a25241fdef9 100644 --- a/common/persistence/nosql/nosqlplugin/cassandra/visibility_cql.go +++ b/common/persistence/nosql/nosqlplugin/cassandra/visibility_cql.go @@ -21,7 +21,7 @@ package cassandra const ( - ///////////////// Open Executions ///////////////// + // /////////////// Open Executions ///////////////// openExecutionsColumnsForSelect = " workflow_id, run_id, start_time, execution_time, workflow_type_name, memo, encoding, task_list, is_cron, num_clusters, update_time, shard_id " openExecutionsColumnsForInsert = "(domain_id, domain_partition, " + openExecutionsColumnsForSelect + ")" @@ -78,7 +78,7 @@ const ( `and start_time = ? ` + `and run_id = ? ` - ///////////////// Closed Executions ///////////////// + // /////////////// Closed Executions ///////////////// closedExecutionColumnsForSelect = " workflow_id, run_id, start_time, execution_time, close_time, workflow_type_name, status, history_length, memo, encoding, task_list, is_cron, num_clusters, update_time, shard_id " closedExecutionColumnsForInsert = "(domain_id, domain_partition, " + closedExecutionColumnsForSelect + ")" diff --git a/common/persistence/nosql/nosqlplugin/dynamodb/tests/dynamodb_persistence_test.go b/common/persistence/nosql/nosqlplugin/dynamodb/tests/dynamodb_persistence_test.go index 3d7133d221e..8ec39df6d39 100644 --- a/common/persistence/nosql/nosqlplugin/dynamodb/tests/dynamodb_persistence_test.go +++ b/common/persistence/nosql/nosqlplugin/dynamodb/tests/dynamodb_persistence_test.go @@ -34,29 +34,29 @@ func TestDynamoDBNoopStruct(t *testing.T) { } func TestDynamoDBHistoryPersistence(t *testing.T) { - //s := new(persistencetests.HistoryV2PersistenceSuite) - //s.TestBase = public.NewTestBaseWithDynamoDB(&persistencetests.TestBaseOptions{}) - //s.TestBase.Setup() - //suite.Run(t, s) + // s := new(persistencetests.HistoryV2PersistenceSuite) + // s.TestBase = public.NewTestBaseWithDynamoDB(&persistencetests.TestBaseOptions{}) + // s.TestBase.Setup() + // suite.Run(t, s) } func TestDynamoDBMatchingPersistence(t *testing.T) { - //s := new(persistencetests.MatchingPersistenceSuite) - //s.TestBase = public.NewTestBaseWithDynamoDB(&persistencetests.TestBaseOptions{}) - //s.TestBase.Setup() - //suite.Run(t, s) + // s := new(persistencetests.MatchingPersistenceSuite) + // s.TestBase = public.NewTestBaseWithDynamoDB(&persistencetests.TestBaseOptions{}) + // s.TestBase.Setup() + // suite.Run(t, s) } func TestDynamoDBDomainPersistence(t *testing.T) { - //s := new(persistencetests.MetadataPersistenceSuiteV2) - //s.TestBase = public.NewTestBaseWithDynamoDB(&persistencetests.TestBaseOptions{}) - //s.TestBase.Setup() - //suite.Run(t, s) + // s := new(persistencetests.MetadataPersistenceSuiteV2) + // s.TestBase = public.NewTestBaseWithDynamoDB(&persistencetests.TestBaseOptions{}) + // s.TestBase.Setup() + // suite.Run(t, s) } func TestDynamoDBQueuePersistence(t *testing.T) { - //s := new(persistencetests.QueuePersistenceSuite) - //s.TestBase = public.NewTestBaseWithDynamoDB(&persistencetests.TestBaseOptions{}) - //s.TestBase.Setup() - //suite.Run(t, s) + // s := new(persistencetests.QueuePersistenceSuite) + // s.TestBase = public.NewTestBaseWithDynamoDB(&persistencetests.TestBaseOptions{}) + // s.TestBase.Setup() + // suite.Run(t, s) } diff --git a/common/persistence/nosql/nosqlplugin/interfaces.go b/common/persistence/nosql/nosqlplugin/interfaces.go index 0fd925bdb81..1850feaa103 100644 --- a/common/persistence/nosql/nosqlplugin/interfaces.go +++ b/common/persistence/nosql/nosqlplugin/interfaces.go @@ -119,7 +119,7 @@ type ( * queue_metadata partition key: (queueType), range key: N/A, query condition column(version) */ MessageQueueCRUD interface { - //Insert message into queue, return error if failed or already exists + // Insert message into queue, return error if failed or already exists // Must return conditionFailed error if row already exists InsertIntoQueue(ctx context.Context, row *QueueMessageRow) error // Get the ID of last message inserted into the queue diff --git a/common/persistence/persistence-tests/executionManagerTest.go b/common/persistence/persistence-tests/executionManagerTest.go index b5db7fe50fc..4a1512d3dfc 100644 --- a/common/persistence/persistence-tests/executionManagerTest.go +++ b/common/persistence/persistence-tests/executionManagerTest.go @@ -1639,7 +1639,7 @@ func (s *ExecutionManagerSuite) TestUpdateWorkflow() { s.T().Logf("Workflow execution last updated: %v\n", info3.LastUpdatedTimestamp) - //update with incorrect rangeID and condition(next_event_id) + // update with incorrect rangeID and condition(next_event_id) err7 := s.UpdateWorkflowExecutionWithRangeID(ctx, failedUpdateInfo, failedUpdateStats, versionHistories, []int64{int64(5)}, nil, int64(12345), int64(3), nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil) s.Error(err7, "expected non nil error.") s.IsType(&p.ShardOwnershipLostError{}, err7) @@ -1744,7 +1744,7 @@ func (s *ExecutionManagerSuite) TestDeleteCurrentWorkflow() { defer cancel() if s.ExecutionManager.GetName() != "cassandra" { - //"this test is only applicable for cassandra (uses TTL based deletes)" + // "this test is only applicable for cassandra (uses TTL based deletes)" return } domainID := "54d15308-e20e-4b91-a00f-a518a3892790" @@ -1930,7 +1930,7 @@ func (s *ExecutionManagerSuite) TestCleanupCorruptedWorkflow() { info2.ExecutionInfo.LastUpdatedTimestamp = info1.ExecutionInfo.LastUpdatedTimestamp s.Equal(info2, info1) - //delete the run + // delete the run err8 := s.DeleteWorkflowExecution(ctx, info0.ExecutionInfo) s.NoError(err8) diff --git a/common/persistence/persistence-tests/metadataPersistenceV2Test.go b/common/persistence/persistence-tests/metadataPersistenceV2Test.go index 326bf04c0a0..42fc0611061 100644 --- a/common/persistence/persistence-tests/metadataPersistenceV2Test.go +++ b/common/persistence/persistence-tests/metadataPersistenceV2Test.go @@ -500,7 +500,7 @@ func (m *MetadataPersistenceSuiteV2) TestConcurrentCreateDomain() { m.Equal(failoverVersion, resp.FailoverVersion) m.Equal(common.InitialPreviousFailoverVersion, resp.PreviousFailoverVersion) - //check domain data + // check domain data ss := strings.Split(resp.Info.Data["k0"], "-") m.Equal(2, len(ss)) vi, err := strconv.Atoi(ss[1]) @@ -689,7 +689,7 @@ func (m *MetadataPersistenceSuiteV2) TestConcurrentUpdateDomain() { m.Equal(failoverVersion, resp3.FailoverVersion) m.Equal(common.InitialPreviousFailoverVersion, resp3.PreviousFailoverVersion) - //check domain data + // check domain data ss := strings.Split(resp3.Info.Data["k0"], "-") m.Equal(2, len(ss)) vi, err := strconv.Atoi(ss[1]) @@ -792,7 +792,7 @@ func (m *MetadataPersistenceSuiteV2) TestUpdateDomain() { updatedStatus := p.DomainStatusDeprecated updatedDescription := "description-updated" updatedOwner := "owner-updated" - //This will overriding the previous key-value pair + // This will overriding the previous key-value pair updatedData := map[string]string{"k1": "v2"} updatedRetention := int32(20) updatedEmitMetric := false diff --git a/common/persistence/persistence-tests/persistenceTestBase.go b/common/persistence/persistence-tests/persistenceTestBase.go index 0be742fd8bc..2fb672107e0 100644 --- a/common/persistence/persistence-tests/persistenceTestBase.go +++ b/common/persistence/persistence-tests/persistenceTestBase.go @@ -582,8 +582,8 @@ func (s *TestBase) ContinueAsNewExecution( }, RangeID: s.ShardInfo.RangeID, Encoding: pickRandomEncoding(), - //To DO: next PR for UpdateWorkflowExecution - //DomainName: s.DomainManager.GetName(), + // To DO: next PR for UpdateWorkflowExecution + // DomainName: s.DomainManager.GetName(), } req.UpdateWorkflowMutation.ExecutionInfo.State = persistence.WorkflowStateCompleted req.UpdateWorkflowMutation.ExecutionInfo.CloseStatus = persistence.WorkflowCloseStatusContinuedAsNew @@ -656,8 +656,8 @@ func (s *TestBase) UpdateWorkflowExecutionAndFinish( VersionHistories: versionHistories, }, Encoding: pickRandomEncoding(), - //To DO: next PR for UpdateWorkflowExecution - //DomainName: s.DomainManager.GetName(), + // To DO: next PR for UpdateWorkflowExecution + // DomainName: s.DomainManager.GetName(), }) return err } diff --git a/common/persistence/pinot/pinot_visibility_store.go b/common/persistence/pinot/pinot_visibility_store.go index 6503b64b98d..9ee0a44268b 100644 --- a/common/persistence/pinot/pinot_visibility_store.go +++ b/common/persistence/pinot/pinot_visibility_store.go @@ -187,7 +187,7 @@ func (v *pinotVisibilityStore) RecordWorkflowExecutionUninitialized(ctx context. 0, -1, // represent invalid close time, means open workflow execution -1, // represent invalid close status, means open workflow execution - 0, //will be updated when workflow execution updates + 0, // will be updated when workflow execution updates request.UpdateTimestamp.UnixMilli(), request.ShardID, nil, @@ -581,7 +581,7 @@ func createVisibilityMessage( isDeleted bool, ) (*indexer.PinotMessage, error) { m := make(map[string]interface{}) - //loop through all input parameters + // loop through all input parameters m[DomainID] = domainID m[WorkflowID] = wid m[RunID] = rid @@ -952,10 +952,10 @@ func getListWorkflowExecutionsQuery(tableName string, request *p.InternalListWor latest := request.LatestTime.UnixMilli() + oneMicroSecondInNano if isClosed { - query.filters.addTimeRange(CloseTime, earliest, latest) //convert Unix Time to miliseconds + query.filters.addTimeRange(CloseTime, earliest, latest) // convert Unix Time to miliseconds query.filters.addGte(CloseStatus, 0) } else { - query.filters.addTimeRange(StartTime, earliest, latest) //convert Unix Time to miliseconds + query.filters.addTimeRange(StartTime, earliest, latest) // convert Unix Time to miliseconds query.filters.addLt(CloseStatus, 0) query.filters.addEqual(CloseTime, -1) } @@ -980,10 +980,10 @@ func getListWorkflowExecutionsByTypeQuery(tableName string, request *p.InternalL latest := request.LatestTime.UnixMilli() + oneMicroSecondInNano if isClosed { - query.filters.addTimeRange(CloseTime, earliest, latest) //convert Unix Time to miliseconds + query.filters.addTimeRange(CloseTime, earliest, latest) // convert Unix Time to miliseconds query.filters.addGte(CloseStatus, 0) } else { - query.filters.addTimeRange(StartTime, earliest, latest) //convert Unix Time to miliseconds + query.filters.addTimeRange(StartTime, earliest, latest) // convert Unix Time to miliseconds query.filters.addLt(CloseStatus, 0) query.filters.addEqual(CloseTime, -1) } @@ -1016,10 +1016,10 @@ func getListWorkflowExecutionsByWorkflowIDQuery(tableName string, request *p.Int latest := request.LatestTime.UnixMilli() + oneMicroSecondInNano if isClosed { - query.filters.addTimeRange(CloseTime, earliest, latest) //convert Unix Time to miliseconds + query.filters.addTimeRange(CloseTime, earliest, latest) // convert Unix Time to miliseconds query.filters.addGte(CloseStatus, 0) } else { - query.filters.addTimeRange(StartTime, earliest, latest) //convert Unix Time to miliseconds + query.filters.addTimeRange(StartTime, earliest, latest) // convert Unix Time to miliseconds query.filters.addLt(CloseStatus, 0) query.filters.addEqual(CloseTime, -1) } @@ -1065,7 +1065,7 @@ func getListWorkflowExecutionsByStatusQuery(tableName string, request *p.Interna } query.filters.addEqual(CloseStatus, status) - query.filters.addTimeRange(CloseTime, request.EarliestTime.UnixMilli(), request.LatestTime.UnixMilli()) //convert Unix Time to miliseconds + query.filters.addTimeRange(CloseTime, request.EarliestTime.UnixMilli(), request.LatestTime.UnixMilli()) // convert Unix Time to miliseconds query.addPinotSorter(StartTime, DescendingOrder) diff --git a/common/persistence/pinotVisibilityTripleManager.go b/common/persistence/pinotVisibilityTripleManager.go index d15c153f56e..da110a17eab 100644 --- a/common/persistence/pinotVisibilityTripleManager.go +++ b/common/persistence/pinotVisibilityTripleManager.go @@ -251,8 +251,8 @@ func (v *pinotVisibilityTripleManager) chooseVisibilityManagerForWrite(ctx conte } switch writeMode { - //only perform as triple manager during migration by setting write mode to triple, - //other time perform as a dual visibility manager of pinot and db + // only perform as triple manager during migration by setting write mode to triple, + // other time perform as a dual visibility manager of pinot and db case common.AdvancedVisibilityWritingModeOff: if v.dbVisibilityManager != nil { return dbVisFunc() diff --git a/common/persistence/sql/sqldriver/interface.go b/common/persistence/sql/sqldriver/interface.go index bcad38c3a6a..bddfda76ae5 100644 --- a/common/persistence/sql/sqldriver/interface.go +++ b/common/persistence/sql/sqldriver/interface.go @@ -31,7 +31,7 @@ import ( type ( // Driver interface is an abstraction to query SQL. - //The layer is added so that we can have a adapter to support multiple SQL databases behind a single Cadence cluster + // The layer is added so that we can have a adapter to support multiple SQL databases behind a single Cadence cluster Driver interface { // shared methods are for both non-transactional (using sqlx.DB) and transactional (using sqlx.Tx) operation -- diff --git a/common/persistence/sql/sqlplugin/mysql/admin.go b/common/persistence/sql/sqlplugin/mysql/admin.go index 1d28390b491..77fe4ecf6be 100644 --- a/common/persistence/sql/sqlplugin/mysql/admin.go +++ b/common/persistence/sql/sqlplugin/mysql/admin.go @@ -50,7 +50,7 @@ const ( `old_version VARCHAR(64), ` + `PRIMARY KEY (year, month, update_time));` - //NOTE we have to use %v because somehow mysql doesn't work with ? here + // NOTE we have to use %v because somehow mysql doesn't work with ? here createDatabaseQuery = "CREATE database %v CHARACTER SET UTF8" dropDatabaseQuery = "Drop database %v" diff --git a/common/persistence/sql/sqlplugin/postgres/plugin.go b/common/persistence/sql/sqlplugin/postgres/plugin.go index 118834e58a2..992c6a04192 100644 --- a/common/persistence/sql/sqlplugin/postgres/plugin.go +++ b/common/persistence/sql/sqlplugin/postgres/plugin.go @@ -112,7 +112,7 @@ func (d *plugin) createSingleDBConn(cfg *config.SQL) (*sqlx.DB, error) { func buildDSN(cfg *config.SQL, host string, port string, params url.Values) string { dbName := cfg.DatabaseName - //NOTE: postgres doesn't allow to connect with empty dbName, the admin dbName is "postgres" + // NOTE: postgres doesn't allow to connect with empty dbName, the admin dbName is "postgres" if dbName == "" { dbName = "postgres" } diff --git a/common/persistence/sql/sqlplugin/postgres/postgres_persistence_test.go b/common/persistence/sql/sqlplugin/postgres/postgres_persistence_test.go index 6f1a2c71488..2725cb09a6a 100644 --- a/common/persistence/sql/sqlplugin/postgres/postgres_persistence_test.go +++ b/common/persistence/sql/sqlplugin/postgres/postgres_persistence_test.go @@ -96,12 +96,12 @@ FAIL: TestPostgresSQLQueuePersistence/TestDomainReplicationQueue (0.26s) actual : 98 Test: TestPostgresSQLQueuePersistence/TestDomainReplicationQueue */ -//func TestPostgresSQLQueuePersistence(t *testing.T) { +// func TestPostgresSQLQueuePersistence(t *testing.T) { // s := new(pt.QueuePersistenceSuite) // s.TestBase = pt.NewTestBaseWithSQL(GetTestClusterOption()) // s.TestBase.Setup() // suite.Run(t, s) -//} +// } func TestPostgresSQLConfigPersistence(t *testing.T) { testflags.RequirePostgres(t) diff --git a/common/persistence/sql/sqlplugin/postgres/typeconv.go b/common/persistence/sql/sqlplugin/postgres/typeconv.go index a5e5e0b1f8c..22747c7e714 100644 --- a/common/persistence/sql/sqlplugin/postgres/typeconv.go +++ b/common/persistence/sql/sqlplugin/postgres/typeconv.go @@ -30,7 +30,7 @@ type ( // go types to postgres datatypes // TODO https://github.com/uber/cadence/issues/2892 // There are some reasons: - //r application layer is not consistent with timezone: for example, + // r application layer is not consistent with timezone: for example, // in some case we write timestamp with local timezone but when the time.Time // is converted from "JSON"(from paging token), the timezone is missing DataConverter interface { diff --git a/common/pinot/pinotQueryValidator.go b/common/pinot/pinotQueryValidator.go index bc987b33eba..0bae73e8e82 100644 --- a/common/pinot/pinotQueryValidator.go +++ b/common/pinot/pinotQueryValidator.go @@ -149,7 +149,7 @@ func (qv *VisibilityQueryValidator) validateRangeExpr(expr sqlparser.Expr) (stri return buf.String(), nil } - //lowerBound, ok := rangeCond.From.(*sqlparser.ColName) + // lowerBound, ok := rangeCond.From.(*sqlparser.ColName) lowerBound, ok := rangeCond.From.(*sqlparser.SQLVal) if !ok { return "", errors.New("invalid range expression: fail to get lowerbound") @@ -415,7 +415,7 @@ func parseTime(timeStr string) (int64, error) { valInt, err := strconv.ParseInt(timeStr, 10, 64) if err == nil { var newVal int64 - if valInt < 0 { //exclude open workflow which time field will be -1 + if valInt < 0 { // exclude open workflow which time field will be -1 newVal = valInt } else if len(timeStr) > 13 { // Assuming nanoseconds if more than 13 digits newVal = valInt / 1000000 // Convert time to milliseconds diff --git a/common/pinot/responseUtility.go b/common/pinot/responseUtility.go index 4a97b0bb509..c635e93b813 100644 --- a/common/pinot/responseUtility.go +++ b/common/pinot/responseUtility.go @@ -88,7 +88,7 @@ func ConvertSearchResultToVisibilityRecord(hit []interface{}, columnNames []stri err = json.Unmarshal(jsonSystemKeyMap, &source) if err != nil { logger.Error("Unable to Unmarshal systemKeyMap", - tag.Error(err), //tag.ESDocID(fmt.Sprintf(columnNameToValue["DocID"])) + tag.Error(err), // tag.ESDocID(fmt.Sprintf(columnNameToValue["DocID"])) ) return nil } diff --git a/common/reconciliation/invariant/concreteExecutionExists.go b/common/reconciliation/invariant/concreteExecutionExists.go index 62c60fd62b0..a67dbefa5c2 100644 --- a/common/reconciliation/invariant/concreteExecutionExists.go +++ b/common/reconciliation/invariant/concreteExecutionExists.go @@ -99,7 +99,7 @@ func (c *concreteExecutionExists) Check( } } if !concreteExecResp.Exists { - //verify if the current execution exists + // verify if the current execution exists _, checkResult := c.validateCurrentRunID(ctx, currentExecution) if checkResult != nil { return *checkResult diff --git a/common/reconciliation/store/blobstoreWriter.go b/common/reconciliation/store/blobstoreWriter.go index 24ce7723ab7..e8f02202e71 100644 --- a/common/reconciliation/store/blobstoreWriter.go +++ b/common/reconciliation/store/blobstoreWriter.go @@ -145,7 +145,7 @@ func getBlobstoreWriteFn( }), ) - //The Do method of throttleRetry is used to execute the operation with retries according to the policy. + // The Do method of throttleRetry is used to execute the operation with retries according to the policy. err := throttleRetry.Do(context.Background(), operation) if err != nil { return nil, err diff --git a/common/reconciliation/store/blobstorewriter_test.go b/common/reconciliation/store/blobstorewriter_test.go index cee7517055e..9dee744a6c8 100644 --- a/common/reconciliation/store/blobstorewriter_test.go +++ b/common/reconciliation/store/blobstorewriter_test.go @@ -60,7 +60,7 @@ func TestBlobstoreWriter(t *testing.T) { cfg := &config.FileBlobstore{ OutputDirectory: outputDir, } - //Reusing the FilestoreClient from the other sister test in the same package. + // Reusing the FilestoreClient from the other sister test in the same package. blobstoreClient, err := filestore.NewFilestoreClient(cfg) require.NoError(t, err) diff --git a/common/testing/event_generator.go b/common/testing/event_generator.go index 3a8a55d6d1d..11a85be6a95 100644 --- a/common/testing/event_generator.go +++ b/common/testing/event_generator.go @@ -449,12 +449,12 @@ func (he *HistoryEventVertex) SetName( } // Equals compares two vertex -//func (he *HistoryEventVertex) Equals( +// func (he *HistoryEventVertex) Equals( // v Vertex, -//) bool { +// ) bool { // // return strings.EqualFold(he.name, v.GetName()) && he.data == v.GetData() -//} +// } // SetIsStrictOnNextVertex sets if a vertex can be added between the current vertex and its child Vertices func (he *HistoryEventVertex) SetIsStrictOnNextVertex( diff --git a/common/testing/generator_interface.go b/common/testing/generator_interface.go index 5847ddfb21b..f9c22f16ea1 100644 --- a/common/testing/generator_interface.go +++ b/common/testing/generator_interface.go @@ -67,7 +67,7 @@ type ( // The name of the vertex. Usually, this will be the Cadence event type SetName(string) GetName() string - //Equals(Vertex) bool + // Equals(Vertex) bool // IsStrictOnNextVertex means if the vertex must be followed by its children // When IsStrictOnNextVertex set to true, it means this event can only follow by its neighbors SetIsStrictOnNextVertex(bool) diff --git a/common/testing/history_event_util.go b/common/testing/history_event_util.go index 14577a06446..18bcf811975 100644 --- a/common/testing/history_event_util.go +++ b/common/testing/history_event_util.go @@ -532,8 +532,8 @@ func InitializeHistoryEventGenerator( activityCancelToDecisionSchedule.SetCondition(notPendingDecisionTask) // TODO: bypass activity cancel request event. Support this event later. - //activityScheduleToActivityCancelRequest := NewHistoryEventEdge(activitySchedule, activityCancelRequest) - //activityScheduleToActivityCancelRequest.SetCondition(hasPendingActivity) + // activityScheduleToActivityCancelRequest := NewHistoryEventEdge(activitySchedule, activityCancelRequest) + // activityScheduleToActivityCancelRequest.SetCondition(hasPendingActivity) activityCancelReqToCancel := NewHistoryEventEdge(activityCancelRequest, activityCancel) activityCancelReqToCancel.SetCondition(hasPendingActivity) diff --git a/common/types/mapper/proto/api.go b/common/types/mapper/proto/api.go index e09d746f87b..d71615e5523 100644 --- a/common/types/mapper/proto/api.go +++ b/common/types/mapper/proto/api.go @@ -4179,7 +4179,7 @@ func FromUpdateDomainRequest(t *types.UpdateDomainRequest) *apiv1.UpdateDomainRe request.WorkflowExecutionRetentionPeriod = daysToDuration(t.WorkflowExecutionRetentionPeriodInDays) fields = append(fields, DomainUpdateRetentionPeriodField) } - //if t.EmitMetric != nil {} - DEPRECATED + // if t.EmitMetric != nil {} - DEPRECATED if t.BadBinaries != nil { request.BadBinaries = FromBadBinaries(t.BadBinaries) fields = append(fields, DomainUpdateBadBinariesField) diff --git a/common/types/shared.go b/common/types/shared.go index 0a94466225f..086f2f6ce87 100644 --- a/common/types/shared.go +++ b/common/types/shared.go @@ -7228,7 +7228,7 @@ type WorkflowExecutionInfo struct { StartTime *int64 `json:"startTime,omitempty"` CloseTime *int64 `json:"closeTime,omitempty"` CloseStatus *WorkflowExecutionCloseStatus `json:"closeStatus,omitempty"` - HistoryLength int64 `json:"historyLength,omitempty"` //should be history count + HistoryLength int64 `json:"historyLength,omitempty"` // should be history count ParentDomainID *string `json:"parentDomainId,omitempty"` ParentDomain *string `json:"parentDomain,omitempty"` ParentExecution *WorkflowExecution `json:"parentExecution,omitempty"` @@ -7839,7 +7839,7 @@ const ( CrossClusterTaskFailedCauseWorkflowAlreadyRunning // CrossClusterTaskFailedCauseWorkflowNotExists is an option for CrossClusterTaskFailedCause CrossClusterTaskFailedCauseWorkflowNotExists - //CrossClusterTaskFailedCauseWorkflowAlreadyCompleted is an option for CrossClusterTaskFailedCause + // CrossClusterTaskFailedCauseWorkflowAlreadyCompleted is an option for CrossClusterTaskFailedCause CrossClusterTaskFailedCauseWorkflowAlreadyCompleted // CrossClusterTaskFailedCauseUncategorized is an option for CrossClusterTaskFailedCause CrossClusterTaskFailedCauseUncategorized diff --git a/host/integration_test.go b/host/integration_test.go index 3f2c0e2fe7e..4a32ba67d12 100644 --- a/host/integration_test.go +++ b/host/integration_test.go @@ -1086,7 +1086,7 @@ func (s *IntegrationSuite) TestWorkflowRetryFailures() { { DecisionType: types.DecisionTypeFailWorkflowExecution.Ptr(), FailWorkflowExecutionDecisionAttributes: &types.FailWorkflowExecutionDecisionAttributes{ - //Reason: common.StringPtr("retryable-error"), + // Reason: common.StringPtr("retryable-error"), Reason: common.StringPtr(errorReason), Details: nil, }, @@ -1235,7 +1235,7 @@ func (s *IntegrationSuite) TestCronWorkflow() { ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(100), TaskStartToCloseTimeoutSeconds: common.Int32Ptr(1), Identity: identity, - CronSchedule: cronSchedule, //minimum interval by standard spec is 1m (* * * * *), use non-standard descriptor for short interval for test + CronSchedule: cronSchedule, // minimum interval by standard spec is 1m (* * * * *), use non-standard descriptor for short interval for test Memo: memo, SearchAttributes: searchAttr, } @@ -1468,7 +1468,7 @@ func (s *IntegrationSuite) TestCronWorkflowTimeout() { ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(1), // set workflow timeout to 1s TaskStartToCloseTimeoutSeconds: common.Int32Ptr(1), Identity: identity, - CronSchedule: cronSchedule, //minimum interval by standard spec is 1m (* * * * *), use non-standard descriptor for short interval for test + CronSchedule: cronSchedule, // minimum interval by standard spec is 1m (* * * * *), use non-standard descriptor for short interval for test Memo: memo, SearchAttributes: searchAttr, RetryPolicy: retryPolicy, @@ -2554,7 +2554,7 @@ func (s *IntegrationSuite) TestCronChildWorkflowExecution() { sort.Slice(closedExecutions, func(i, j int) bool { return closedExecutions[i].GetStartTime() < closedExecutions[j].GetStartTime() }) - //The first parent is not the cron workflow, only verify child workflow with cron schedule + // The first parent is not the cron workflow, only verify child workflow with cron schedule lastExecution := closedExecutions[1] for i := 2; i != 4; i++ { executionInfo := closedExecutions[i] @@ -2705,7 +2705,7 @@ func (s *IntegrationSuite) TestDecisionTaskFailed() { signalCount := 0 sendSignal := false lastDecisionTimestamp := int64(0) - //var signalEvent *types.HistoryEvent + // var signalEvent *types.HistoryEvent dtHandler := func(execution *types.WorkflowExecution, wt *types.WorkflowType, previousStartedEventID, startedEventID int64, history *types.History) ([]byte, []*types.Decision, error) { // Count signals @@ -3035,7 +3035,7 @@ func (s *IntegrationSuite) TestTransientDecisionTimeout() { workflowComplete := false failDecision := true signalCount := 0 - //var signalEvent *types.HistoryEvent + // var signalEvent *types.HistoryEvent dtHandler := func(execution *types.WorkflowExecution, wt *types.WorkflowType, previousStartedEventID, startedEventID int64, history *types.History) ([]byte, []*types.Decision, error) { if failDecision { @@ -3698,7 +3698,7 @@ func (s *IntegrationSuite) TestStickyTasklistResetThenTimeout() { ctx, cancel = createContext() defer cancel() - //Reset sticky tasklist before sticky decision task starts + // Reset sticky tasklist before sticky decision task starts s.engine.ResetStickyTaskList(ctx, &types.ResetStickyTaskListRequest{ Domain: s.domainName, Execution: workflowExecution, diff --git a/host/pinot_test.go b/host/pinot_test.go index 142ace3cdd1..bcb41f6ee2d 100644 --- a/host/pinot_test.go +++ b/host/pinot_test.go @@ -127,7 +127,7 @@ func (s *PinotIntegrationSuite) SetupSuite() { // background only every domainCacheRefreshInterval period time.Sleep(cache.DomainCacheRefreshInterval + time.Second) - tableName := "cadence_visibility_pinot" //cadence_visibility_pinot_integration_test + tableName := "cadence_visibility_pinot" // cadence_visibility_pinot_integration_test pinotConfig := &config.PinotVisibilityConfig{ Cluster: "", Broker: "localhost:8099", @@ -648,7 +648,7 @@ func (s *PinotIntegrationSuite) TestListWorkflow_OrderBy() { time.Sleep(waitForPinotToSettle) - //desc := "desc" + // desc := "desc" asc := "asc" queryTemplate := `WorkflowType = "%s" order by %s %s` pageSize := int32(defaultTestValueOfESIndexMaxResultWindow) @@ -677,7 +677,7 @@ func (s *PinotIntegrationSuite) TestListWorkflow_OrderBy() { // comment out things below, because json index column can't use order by // greatest effort to reduce duplicate code - //testHelper := func(query, searchAttrKey string, prevVal, currVal interface{}) { + // testHelper := func(query, searchAttrKey string, prevVal, currVal interface{}) { // listRequest.Query = query // listRequest.NextPageToken = []byte{} // resp, err := s.engine.ListWorkflowExecutions(createContext(), listRequest) @@ -721,32 +721,32 @@ func (s *PinotIntegrationSuite) TestListWorkflow_OrderBy() { // resp, err = s.engine.ListWorkflowExecutions(createContext(), listRequest) // last page // s.Nil(err) // s.Equal(1, len(resp.GetExecutions())) - //} + // } // - //// order by CustomIntField desc - //field := definition.CustomIntField - //query := fmt.Sprintf(queryTemplate, wt, field, desc) - //var int1, int2 int - //testHelper(query, field, int1, int2) + // // order by CustomIntField desc + // field := definition.CustomIntField + // query := fmt.Sprintf(queryTemplate, wt, field, desc) + // var int1, int2 int + // testHelper(query, field, int1, int2) // - //// order by CustomDoubleField desc - //field = definition.CustomDoubleField - //query = fmt.Sprintf(queryTemplate, wt, field, desc) - //var double1, double2 float64 - //testHelper(query, field, double1, double2) + // // order by CustomDoubleField desc + // field = definition.CustomDoubleField + // query = fmt.Sprintf(queryTemplate, wt, field, desc) + // var double1, double2 float64 + // testHelper(query, field, double1, double2) // - //// order by CustomKeywordField desc - //field = definition.CustomKeywordField - //query = fmt.Sprintf(queryTemplate, wt, field, desc) - //var s1, s2 string - //testHelper(query, field, s1, s2) + // // order by CustomKeywordField desc + // field = definition.CustomKeywordField + // query = fmt.Sprintf(queryTemplate, wt, field, desc) + // var s1, s2 string + // testHelper(query, field, s1, s2) // - //// order by CustomDatetimeField desc - //field = definition.CustomDatetimeField - //query = fmt.Sprintf(queryTemplate, wt, field, desc) - //var t1, t2 time.Time - //testHelper(query, field, t1, t2) + // // order by CustomDatetimeField desc + // field = definition.CustomDatetimeField + // query = fmt.Sprintf(queryTemplate, wt, field, desc) + // var t1, t2 time.Time + // testHelper(query, field, t1, t2) } func (s *PinotIntegrationSuite) testListWorkflowHelper(numOfWorkflows, pageSize int, @@ -809,8 +809,8 @@ func (s *PinotIntegrationSuite) testListWorkflowHelper(numOfWorkflows, pageSize } s.Nil(err) - //ans, _ := json.Marshal(resp.GetExecutions()) - //panic(fmt.Sprintf("ABUCSDK: %s", ans)) + // ans, _ := json.Marshal(resp.GetExecutions()) + // panic(fmt.Sprintf("ABUCSDK: %s", ans)) if len(resp.GetExecutions()) == numOfWorkflows-pageSize { inIf = true @@ -1050,7 +1050,7 @@ func (s *PinotIntegrationSuite) TestUpsertWorkflowExecution() { listRequest := &types.ListWorkflowExecutionsRequest{ Domain: s.domainName, PageSize: int32(2), - //Query: fmt.Sprintf(`WorkflowType = '%s' and CloseTime = missing`, wt), + // Query: fmt.Sprintf(`WorkflowType = '%s' and CloseTime = missing`, wt), Query: fmt.Sprintf(`WorkflowType = '%s' and CloseTime = missing`, wt), } verified := false @@ -1106,14 +1106,14 @@ func (s *PinotIntegrationSuite) testListResultForUpsertSearchAttributes(listRequ resp, err := s.engine.ListWorkflowExecutions(ctx, listRequest) s.Nil(err) - //res2B, _ := json.Marshal(resp.GetExecutions()) - //panic(fmt.Sprintf("ABCDDDBUG: %s", listRequest.Query)) + // res2B, _ := json.Marshal(resp.GetExecutions()) + // panic(fmt.Sprintf("ABCDDDBUG: %s", listRequest.Query)) if len(resp.GetExecutions()) == 1 { execution := resp.GetExecutions()[0] retrievedSearchAttr := execution.SearchAttributes if retrievedSearchAttr != nil && len(retrievedSearchAttr.GetIndexedFields()) == 3 { - //if retrievedSearchAttr != nil && len(retrievedSearchAttr.GetIndexedFields()) > 0 { + // if retrievedSearchAttr != nil && len(retrievedSearchAttr.GetIndexedFields()) > 0 { fields := retrievedSearchAttr.GetIndexedFields() searchValBytes := fields[s.testSearchAttributeKey] var searchVal string diff --git a/host/signal_workflow_test.go b/host/signal_workflow_test.go index 6cc938224d6..865c27e67b5 100644 --- a/host/signal_workflow_test.go +++ b/host/signal_workflow_test.go @@ -570,7 +570,7 @@ CheckHistoryLoopForSignalSent: cancel() s.Nil(err) history := historyResponse.History - //common.PrettyPrintHistory(history, s.Logger) + // common.PrettyPrintHistory(history, s.Logger) signalRequestedEvent := history.Events[len(history.Events)-2] if *signalRequestedEvent.EventType != types.EventTypeExternalWorkflowExecutionSignaled { diff --git a/host/xdc/elasticsearch_test.go b/host/xdc/elasticsearch_test.go index 23de28867ce..822634f9880 100644 --- a/host/xdc/elasticsearch_test.go +++ b/host/xdc/elasticsearch_test.go @@ -114,7 +114,7 @@ func (s *esCrossDCTestSuite) SetupSuite() { s.cluster2 = c s.esClient = esutils.CreateESClient(s.Suite, s.clusterConfigs[0].ESConfig.URL.String(), "v6") - //TODO Do we also want to run v7 test here? + // TODO Do we also want to run v7 test here? s.esClient.PutIndexTemplate(s.Suite, "../testdata/es_index_v6_template.json", "test-visibility-template") s.esClient.CreateIndex(s.Suite, s.clusterConfigs[0].ESConfig.Indices[common.VisibilityAppName]) s.esClient.CreateIndex(s.Suite, s.clusterConfigs[1].ESConfig.Indices[common.VisibilityAppName]) diff --git a/service/frontend/api/handler_test.go b/service/frontend/api/handler_test.go index 0af59af4c52..014b94a127d 100644 --- a/service/frontend/api/handler_test.go +++ b/service/frontend/api/handler_test.go @@ -629,7 +629,7 @@ func (s *workflowHandlerSuite) TestRecordActivityTaskHeartbeat_RequestNotSet() { func (s *workflowHandlerSuite) TestRecordActivityTaskHeartbeat_TaskTokenNotSet() { wh := s.getWorkflowHandler(s.newConfig(dc.NewInMemoryClient())) result, err := wh.RecordActivityTaskHeartbeat(context.Background(), &types.RecordActivityTaskHeartbeatRequest{ - TaskToken: nil, //task token is not set + TaskToken: nil, // task token is not set Details: nil, Identity: "", }) diff --git a/service/history/engine/engineimpl/historyEngine.go b/service/history/engine/engineimpl/historyEngine.go index fae4ba69a56..b089b284a77 100644 --- a/service/history/engine/engineimpl/historyEngine.go +++ b/service/history/engine/engineimpl/historyEngine.go @@ -726,8 +726,8 @@ func (e *historyEngineImpl) startWorkflowHelper( ) if err != nil { if e.shard.GetConfig().EnableRecordWorkflowExecutionUninitialized(domainEntry.GetInfo().Name) && e.visibilityMgr != nil { - //delete the uninitialized workflow execution record since it failed to start the workflow - //uninitialized record is used to find wfs that didn't make a progress or stuck during the start process + // delete the uninitialized workflow execution record since it failed to start the workflow + // uninitialized record is used to find wfs that didn't make a progress or stuck during the start process if errVisibility := e.visibilityMgr.DeleteWorkflowExecution(ctx, &persistence.VisibilityDeleteWorkflowExecutionRequest{ DomainID: domainID, Domain: domain, @@ -3416,7 +3416,7 @@ func (e *historyEngineImpl) GetReplicationMessages( return nil, err } - //Set cluster status for sync shard info + // Set cluster status for sync shard info replicationMessages.SyncShardStatus = &types.SyncShardStatus{ Timestamp: common.Int64Ptr(e.timeSource.Now().UnixNano()), } diff --git a/service/history/execution/context.go b/service/history/execution/context.go index 8038e86971e..0de4bd038b5 100644 --- a/service/history/execution/context.go +++ b/service/history/execution/context.go @@ -1233,13 +1233,13 @@ func (c *contextImpl) updateWorkflowExecutionWithRetry( resp, err = c.shard.UpdateWorkflowExecution(ctx, request) return err } - //Preparation for the task Validation. - //metricsClient := c.shard.GetMetricsClient() - //domainCache := c.shard.GetDomainCache() - //executionManager := c.shard.GetExecutionManager() - //historymanager := c.shard.GetHistoryManager() - //zapLogger, _ := zap.NewProduction() - //checker, _ := taskvalidator.NewWfChecker(zapLogger, metricsClient, domainCache, executionManager, historymanager) + // Preparation for the task Validation. + // metricsClient := c.shard.GetMetricsClient() + // domainCache := c.shard.GetDomainCache() + // executionManager := c.shard.GetExecutionManager() + // historymanager := c.shard.GetHistoryManager() + // zapLogger, _ := zap.NewProduction() + // checker, _ := taskvalidator.NewWfChecker(zapLogger, metricsClient, domainCache, executionManager, historymanager) isRetryable := func(err error) bool { if _, ok := err.(*persistence.TimeoutError); ok { @@ -1269,17 +1269,17 @@ func (c *contextImpl) updateWorkflowExecutionWithRetry( tag.Error(err), tag.Number(c.updateCondition), ) - //TODO: Call the Task Validation here so that it happens whenever an error happen during Update. - //err1 := checker.WorkflowCheckforValidation( + // TODO: Call the Task Validation here so that it happens whenever an error happen during Update. + // err1 := checker.WorkflowCheckforValidation( // ctx, // c.workflowExecution.GetWorkflowID(), // c.domainID, // c.GetDomainName(), // c.workflowExecution.GetRunID(), - //) - //if err1 != nil { + // ) + // if err1 != nil { // return nil, err1 - //} + // } return nil, err } } diff --git a/service/history/execution/history_builder.go b/service/history/execution/history_builder.go index a7b62068066..28856fb420f 100644 --- a/service/history/execution/history_builder.go +++ b/service/history/execution/history_builder.go @@ -71,7 +71,7 @@ func (b *HistoryBuilder) AddWorkflowExecutionStartedEvent(startRequest *types.Hi var scheduledTime *time.Time if request.CronSchedule != "" { - //first scheduled time is only necessary for cron workflows. + // first scheduled time is only necessary for cron workflows. scheduledTime = &firstScheduledTime } attributes := &types.WorkflowExecutionStartedEventAttributes{ diff --git a/service/history/failover/coordinator_test.go b/service/history/failover/coordinator_test.go index 3bfab6623e6..35cf038bc95 100644 --- a/service/history/failover/coordinator_test.go +++ b/service/history/failover/coordinator_test.go @@ -424,7 +424,7 @@ func (s *coordinatorSuite) TestHandleFailoverMarkers_CleanPendingActiveState_Err func (s *coordinatorSuite) TestGetFailoverInfo_Success() { domainID := uuid.New() - //Add failover marker + // Add failover marker attributes := &types.FailoverMarkerAttributes{ DomainID: domainID, FailoverVersion: 2, diff --git a/service/history/handler/interface.go b/service/history/handler/interface.go index 37991f6fc09..afd8d0dafdd 100644 --- a/service/history/handler/interface.go +++ b/service/history/handler/interface.go @@ -35,9 +35,9 @@ import ( type Handler interface { // Do not use embeded methods, otherwise, we got the following error from gowrap // and we only get this error from history/interface.go, not sure why - //failed to parse interface declaration: Daemon: target declaration not found - //service/history/interface.go:22: running "gowrap": exit status 1 - //common.Daemon + // failed to parse interface declaration: Daemon: target declaration not found + // service/history/interface.go:22: running "gowrap": exit status 1 + // common.Daemon Start() Stop() diff --git a/service/history/queue/split_policy_test.go b/service/history/queue/split_policy_test.go index 674e5709b29..2f8d4615ed0 100644 --- a/service/history/queue/split_policy_test.go +++ b/service/history/queue/split_policy_test.go @@ -91,7 +91,7 @@ func (s *splitPolicySuite) TestPendingTaskSplitPolicy() { testCases := []struct { currentState ProcessingQueueState - numPendingTasksPerDomain map[string]int //domainID -> number of pending tasks + numPendingTasksPerDomain map[string]int // domainID -> number of pending tasks expectedNewStates []ProcessingQueueState }{ { @@ -565,7 +565,7 @@ func (s *splitPolicySuite) TestRandomSplitPolicy() { testCases := []struct { currentState ProcessingQueueState splitProbability float64 - numPendingTasksPerDomain map[string]int //domainID -> number of pending tasks + numPendingTasksPerDomain map[string]int // domainID -> number of pending tasks expectedNewStates []ProcessingQueueState }{ { diff --git a/service/history/replication/task_hydrator.go b/service/history/replication/task_hydrator.go index 93652d0dfe9..f96d1e360b6 100644 --- a/service/history/replication/task_hydrator.go +++ b/service/history/replication/task_hydrator.go @@ -142,7 +142,7 @@ func hydrateSyncActivityTask(task persistence.ReplicationTaskInfo, ms mutableSta startedTime = timeToUnixNano(activityInfo.StartedTime) } - //Version history uses when replicate the sync activity task + // Version history uses when replicate the sync activity task var versionHistory *types.VersionHistory if versionHistories := ms.GetVersionHistories(); versionHistories != nil { currentVersionHistory, err := versionHistories.GetCurrentVersionHistory() diff --git a/service/history/replication/task_hydrator_test.go b/service/history/replication/task_hydrator_test.go index 43e6c04b2c4..ad088301ac0 100644 --- a/service/history/replication/task_hydrator_test.go +++ b/service/history/replication/task_hydrator_test.go @@ -507,7 +507,7 @@ func TestHistoryLoader_GetEventBlob(t *testing.T) { domains: fakeDomainCache{testDomainID: testDomain}, mockHistory: func(hm *mocks.HistoryV2Manager) { hm.On("ReadRawHistoryBranch", mock.Anything, mock.Anything).Return(&persistence.ReadRawHistoryBranchResponse{ - HistoryEventBlobs: []*persistence.DataBlob{{}, {}}, //two blobs + HistoryEventBlobs: []*persistence.DataBlob{{}, {}}, // two blobs }, nil) }, expectErr: "replication hydrator encountered more than 1 NDC raw event batch", diff --git a/service/history/replication/task_processor.go b/service/history/replication/task_processor.go index 7c522a8cb7b..e431bcc48a4 100644 --- a/service/history/replication/task_processor.go +++ b/service/history/replication/task_processor.go @@ -389,7 +389,7 @@ func (p *taskProcessorImpl) processSingleTask(replicationTask *types.Replication }) } - //Handle service busy error + // Handle service busy error throttleRetry := backoff.NewThrottleRetry( backoff.WithRetryPolicy(common.CreateReplicationServiceBusyRetryPolicy()), backoff.WithRetryableError(common.IsServiceBusyError), @@ -406,7 +406,7 @@ func (p *taskProcessorImpl) processSingleTask(replicationTask *types.Replication p.logger.Warn("Encounter workflow withour version histories") return nil default: - //handle error + // handle error } // handle error to DLQ @@ -429,11 +429,11 @@ func (p *taskProcessorImpl) processSingleTask(replicationTask *types.Replication tag.TaskType(request.TaskInfo.GetTaskType()), tag.Error(err), ) - //TODO: uncomment this when the execution fixer workflow is ready - //if err = p.triggerDataInconsistencyScan(replicationTask); err != nil { + // TODO: uncomment this when the execution fixer workflow is ready + // if err = p.triggerDataInconsistencyScan(replicationTask); err != nil { // p.logger.Warn("Failed to trigger data scan", tag.Error(err)) // p.metricsClient.IncCounter(metrics.ReplicationDLQStatsScope, metrics.ReplicationDLQValidationFailed) - //} + // } return p.putReplicationTaskToDLQ(request) } } diff --git a/service/history/reset/resetter.go b/service/history/reset/resetter.go index a37301addb7..d5bfe45ee19 100644 --- a/service/history/reset/resetter.go +++ b/service/history/reset/resetter.go @@ -663,7 +663,7 @@ func (r *workflowResetterImpl) closePendingDecisionTask( } } else if decision, ok := resetMutableState.GetPendingDecision(); ok { if ok { - //reset workflow has decision task schedule + // reset workflow has decision task schedule _, err := resetMutableState.AddDecisionTaskResetTimeoutEvent( decision.ScheduleID, baseRunID, diff --git a/service/history/task/interface.go b/service/history/task/interface.go index 1946e8a0ba4..fd861f3af84 100644 --- a/service/history/task/interface.go +++ b/service/history/task/interface.go @@ -111,7 +111,7 @@ type ( Fetch(shardID int, fetchParams ...interface{}) future.Future } - //Fetchers is a group of Fetchers, one for each source cluster + // Fetchers is a group of Fetchers, one for each source cluster Fetchers []Fetcher // QueueType is the type of task queue diff --git a/service/history/workflow/util.go b/service/history/workflow/util.go index 90daa59bd38..2aeb04ae12a 100644 --- a/service/history/workflow/util.go +++ b/service/history/workflow/util.go @@ -127,7 +127,7 @@ func Load( return nil, &types.InternalServiceError{Message: "unable to locate current workflow execution"} } -/////////////////// Util function for updating workflows /////////////////// +// ///////////////// Util function for updating workflows /////////////////// // UpdateWithActionFunc updates the given workflow execution. // If runID is empty, it only tries to load the current workflow once. diff --git a/service/matching/matchingEngine.go b/service/matching/matchingEngine.go index fe3dc004ad8..ec37b29926d 100644 --- a/service/matching/matchingEngine.go +++ b/service/matching/matchingEngine.go @@ -95,10 +95,10 @@ type ( } // HistoryInfo consists of two integer regarding the history size and history count - //HistoryInfo struct { + // HistoryInfo struct { // historySize int64 // historyCount int64 - //} + // } ) var ( diff --git a/service/worker/esanalyzer/analyzer_test.go b/service/worker/esanalyzer/analyzer_test.go index c9d412d499a..9d7e127d781 100644 --- a/service/worker/esanalyzer/analyzer_test.go +++ b/service/worker/esanalyzer/analyzer_test.go @@ -127,7 +127,7 @@ func (s *esanalyzerWorkflowTestSuite) SetupTest() { s.mockESClient = &esMocks.GenericClient{} // - //s.mockDomainCache.EXPECT().GetDomainByID(s.DomainID).Return(activeDomainCache, nil).AnyTimes() + // s.mockDomainCache.EXPECT().GetDomainByID(s.DomainID).Return(activeDomainCache, nil).AnyTimes() s.mockDomainCache.EXPECT().GetDomain(s.DomainName).Return(activeDomainCache, nil).AnyTimes() // SET UP ANALYZER diff --git a/service/worker/indexer/esProcessor_test.go b/service/worker/indexer/esProcessor_test.go index 389af6565d4..004f313ebc6 100644 --- a/service/worker/indexer/esProcessor_test.go +++ b/service/worker/indexer/esProcessor_test.go @@ -238,7 +238,7 @@ func (s *esProcessorSuite) TestBulkAfterAction_Nack() { s.esProcessor.mapToKafkaMsg.Put(testKey, mapVal) mockKafkaMsg.On("Nack").Return(nil).Once() mockKafkaMsg.On("Value").Return(payload).Once() - //s.mockBulkProcessor.On("RetrieveKafkaKey", request, mock.Anything, mock.Anything).Return(testKey) + // s.mockBulkProcessor.On("RetrieveKafkaKey", request, mock.Anything, mock.Anything).Return(testKey) s.esProcessor.bulkAfterAction(0, requests, response, nil) mockKafkaMsg.AssertExpectations(s.T()) } diff --git a/service/worker/parentclosepolicy/workflow.go b/service/worker/parentclosepolicy/workflow.go index caff4fb89b9..60876fd3f9f 100644 --- a/service/worker/parentclosepolicy/workflow.go +++ b/service/worker/parentclosepolicy/workflow.go @@ -156,7 +156,7 @@ func ProcessorActivity(ctx context.Context, request Request) error { switch execution.Policy { case types.ParentClosePolicyAbandon: - //no-op + // no-op continue case types.ParentClosePolicyTerminate: terminateReq := &types.HistoryTerminateWorkflowExecutionRequest{ diff --git a/service/worker/scanner/executions/types.go b/service/worker/scanner/executions/types.go index 4c105e695df..a0a9e8b7aa3 100644 --- a/service/worker/scanner/executions/types.go +++ b/service/worker/scanner/executions/types.go @@ -50,10 +50,10 @@ const ( type ScanType int type ( - //InvariantFactory represents a function which returns Invariant + // InvariantFactory represents a function which returns Invariant InvariantFactory func(retryer persistence.Retryer, domainCache cache.DomainCache) invariant.Invariant - //ExecutionFetcher represents a function which returns specific execution entity + // ExecutionFetcher represents a function which returns specific execution entity ExecutionFetcher func(ctx context.Context, retryer persistence.Retryer, request fetcher.ExecutionRequest) (entity.Entity, error) ) diff --git a/service/worker/scanner/history/scavenger.go b/service/worker/scanner/history/scavenger.go index 9ba3f0624a4..391efaa9a62 100644 --- a/service/worker/scanner/history/scavenger.go +++ b/service/worker/scanner/history/scavenger.go @@ -251,7 +251,7 @@ func (s *Scavenger) startTaskProcessor( if err != nil { if _, ok := err.(*types.EntityNotExistsError); ok { - //deleting history branch + // deleting history branch var branchToken []byte branchToken, err = p.NewHistoryBranchTokenByBranchID(task.treeID, task.branchID) if err != nil { diff --git a/service/worker/scanner/timers/timers_test.go b/service/worker/scanner/timers/timers_test.go index ad488ae6924..b0db513ded2 100644 --- a/service/worker/scanner/timers/timers_test.go +++ b/service/worker/scanner/timers/timers_test.go @@ -131,7 +131,7 @@ func (s *timersWorkflowsSuite) TestScannerWorkflow_Success() { }) } } - //var customc shardscanner.CustomScannerConfig + // var customc shardscanner.CustomScannerConfig env.OnActivity(shardscanner.ActivityScanShard, mock.Anything, shardscanner.ScanShardActivityParams{ Shards: batch, ScannerConfig: cconfig, diff --git a/tools/cli/domain.go b/tools/cli/domain.go index 327f472f74f..9ab3d87aa02 100644 --- a/tools/cli/domain.go +++ b/tools/cli/domain.go @@ -35,7 +35,7 @@ func SetRequiredDomainDataKeys(keys []string) { } func checkRequiredDomainDataKVs(domainData map[string]string) error { - //check requiredDomainDataKeys + // check requiredDomainDataKeys for _, k := range requiredDomainDataKeys { _, ok := domainData[k] if !ok { diff --git a/tools/cli/workflow.go b/tools/cli/workflow.go index 332cb51e109..8ef94acf228 100644 --- a/tools/cli/workflow.go +++ b/tools/cli/workflow.go @@ -514,7 +514,7 @@ func newBatchCommands() []cli.Command { Name: FlagBatchTypeWithAlias, Usage: "Types supported: " + strings.Join(batcher.AllBatchTypes, ","), }, - //below are optional + // below are optional cli.StringFlag{ Name: FlagSignalNameWithAlias, Usage: "Required for batch signal",