Skip to content

Commit

Permalink
Fix warnings when compiling the source code (#4036)
Browse files Browse the repository at this point in the history
**What changed?**

Fix some warnings when `make bins`

**Why?**

The suggestion was reasonable, so we should fix it as we can

**How did you test it?**

* `make bins` to check whether those warnings were disappeared or not 
* make test

**Potential risks**

no
  • Loading branch information
git-hulk authored Mar 9, 2021
1 parent 1b3436c commit d7efde4
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 31 deletions.
18 changes: 4 additions & 14 deletions common/domain/replication_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,11 @@ func (q *replicationQueueImpl) UpdateDLQAckLevel(
ctx context.Context,
lastProcessedMessageID int64,
) error {

if err := q.queue.UpdateDLQAckLevel(
return q.queue.UpdateDLQAckLevel(
ctx,
lastProcessedMessageID,
localDomainReplicationCluster,
); err != nil {
return err
}

return nil
)
}

func (q *replicationQueueImpl) GetDLQAckLevel(
Expand All @@ -261,16 +256,11 @@ func (q *replicationQueueImpl) RangeDeleteMessagesFromDLQ(
firstMessageID int64,
lastMessageID int64,
) error {

if err := q.queue.RangeDeleteMessagesFromDLQ(
return q.queue.RangeDeleteMessagesFromDLQ(
ctx,
firstMessageID,
lastMessageID,
); err != nil {
return err
}

return nil
)
}

func (q *replicationQueueImpl) DeleteMessageFromDLQ(
Expand Down
6 changes: 1 addition & 5 deletions common/persistence/nosql/nosqlplugin/cassandra/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,5 @@ func (db *cdb) deleteDomain(
}

query = db.session.Query(templateDeleteDomainQuery, ID).WithContext(ctx)
if err := query.Exec(); err != nil {
return err
}

return nil
return query.Exec()
}
5 changes: 1 addition & 4 deletions common/service/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,7 @@ func (c *Config) ValidateAndFillDefaults() error {
if err := c.validate(); err != nil {
return err
}
if err := c.fillDefaults(); err != nil {
return err
}
return nil
return c.fillDefaults()
}

func (c *Config) validate() error {
Expand Down
7 changes: 2 additions & 5 deletions service/history/task/transfer_active_task_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ func (t *transferActiveTaskExecutor) processResetWorkflow(
// reset workflow needs to go through the history so it may take a long time.
// as a result it's not subject to the taskDefaultTimeout. Otherwise the task
// may got stuck if the workflow history is large.
if err := t.resetWorkflow(
return t.resetWorkflow(
task,
domainEntry.GetInfo().Name,
reason,
Expand All @@ -911,10 +911,7 @@ func (t *transferActiveTaskExecutor) processResetWorkflow(
currentContext,
currentMutableState,
logger,
); err != nil {
return err
}
return nil
)
}

func (t *transferActiveTaskExecutor) recordChildExecutionStarted(
Expand Down
6 changes: 5 additions & 1 deletion service/worker/batcher/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ import (
"github.com/uber/cadence/common/types"
)

type (
contextKey string
)

const (
batcherContextKey = "batcherContext"
batcherContextKey contextKey = "batcherContext"
// BatcherTaskListName is the tasklist name
BatcherTaskListName = "cadence-sys-batcher-tasklist"
// BatchWFTypeName is the workflow type
Expand Down
6 changes: 5 additions & 1 deletion service/worker/failovermanager/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ import (
"github.com/uber/cadence/common/types"
)

type (
contextKey string
)

const (
failoverManagerContextKey = "failoverManagerContext"
failoverManagerContextKey contextKey = "failoverManagerContext"
// TaskListName tasklist
TaskListName = "cadence-sys-failoverManager-tasklist"
// WorkflowTypeName workflow type name
Expand Down
6 changes: 5 additions & 1 deletion service/worker/parentclosepolicy/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ import (
"github.com/uber/cadence/common/types"
)

type (
contextKey string
)

const (
processorContextKey = "processorContext"
processorContextKey contextKey = "processorContext"
// processorTaskListName is the tasklist name
processorTaskListName = "cadence-sys-processor-parent-close-policy"
// processorWFTypeName is the workflow type
Expand Down

0 comments on commit d7efde4

Please sign in to comment.