From 63c19369f8015a108709bd7786f5d132a5327127 Mon Sep 17 00:00:00 2001 From: Seth Hoenig Date: Tue, 3 Mar 2020 17:30:22 -0600 Subject: [PATCH] client: use consistent name for struct receiver parameter This helps reduce the number of squiggly lines in Goland. --- command/agent/consul/structs.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/command/agent/consul/structs.go b/command/agent/consul/structs.go index 0aa21f3cc03..b41387a77df 100644 --- a/command/agent/consul/structs.go +++ b/command/agent/consul/structs.go @@ -73,22 +73,22 @@ func BuildAllocServices(node *structs.Node, alloc *structs.Allocation, restarter } // Copy method for easing tests -func (t *WorkloadServices) Copy() *WorkloadServices { +func (ws *WorkloadServices) Copy() *WorkloadServices { newTS := new(WorkloadServices) - *newTS = *t + *newTS = *ws // Deep copy Services - newTS.Services = make([]*structs.Service, len(t.Services)) - for i := range t.Services { - newTS.Services[i] = t.Services[i].Copy() + newTS.Services = make([]*structs.Service, len(ws.Services)) + for i := range ws.Services { + newTS.Services[i] = ws.Services[i].Copy() } return newTS } -func (w *WorkloadServices) Name() string { - if w.Task != "" { - return w.Task +func (ws *WorkloadServices) Name() string { + if ws.Task != "" { + return ws.Task } - return "group-" + w.Group + return "group-" + ws.Group }