diff --git a/service/frontend/workflowHandler.go b/service/frontend/workflowHandler.go index 260549e9cd1..d1a79e36463 100644 --- a/service/frontend/workflowHandler.go +++ b/service/frontend/workflowHandler.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Uber Technologies, Inc. +// Copyright (c) 2017-2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -3228,7 +3228,10 @@ func (wh *WorkflowHandler) DescribeTaskList( } // ListTaskListPartitions returns all the partition and host for a taskList -func (wh *WorkflowHandler) ListTaskListPartitions(ctx context.Context, request *gen.ListTaskListPartitionsRequest) (resp *gen.ListTaskListPartitionsResponse, retError error) { +func (wh *WorkflowHandler) ListTaskListPartitions( + ctx context.Context, + request *gen.ListTaskListPartitionsRequest, +) (resp *gen.ListTaskListPartitionsResponse, retError error) { defer log.CapturePanic(wh.GetLogger(), &retError) scope, sw := wh.startRequestProfileWithDomain(metrics.FrontendListTaskListPartitionsScope, request) diff --git a/service/matching/matchingEngine.go b/service/matching/matchingEngine.go index 743b60d9d95..526a0c52d1d 100644 --- a/service/matching/matchingEngine.go +++ b/service/matching/matchingEngine.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Uber Technologies, Inc. +// Copyright (c) 2017-2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -600,7 +600,10 @@ func (e *matchingEngineImpl) ListTaskListPartitions( return &resp, nil } -func (e *matchingEngineImpl) listTaskListPartitions(request *m.ListTaskListPartitionsRequest, taskListType int) ([]*workflow.TaskListPartitionMetadata, error) { +func (e *matchingEngineImpl) listTaskListPartitions( + request *m.ListTaskListPartitionsRequest, + taskListType int, +) ([]*workflow.TaskListPartitionMetadata, error) { partitions, err := e.getAllPartitions( request.GetDomain(), *request.TaskList, @@ -609,11 +612,8 @@ func (e *matchingEngineImpl) listTaskListPartitions(request *m.ListTaskListParti if err != nil { return nil, err } - partitionHostInfo := make([]*workflow.TaskListPartitionMetadata, len(partitions)) - if err != nil { - return nil, err - } + var partitionHostInfo []*workflow.TaskListPartitionMetadata for _, partition := range partitions { if host, err := e.getHostInfo(partition); err != nil { partitionHostInfo = append(partitionHostInfo,