Skip to content

Commit

Permalink
client: use consistent name for struct receiver parameter
Browse files Browse the repository at this point in the history
This helps reduce the number of squiggly lines in Goland.
  • Loading branch information
shoenig committed Mar 30, 2020
1 parent a86e575 commit 63c1936
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions command/agent/consul/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 63c1936

Please sign in to comment.