From a8023b74bdd3d85cb0f3a55485887d133d2c0946 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 9 May 2021 12:47:40 +0200 Subject: [PATCH] safcm: use better variable name in hostsToSync() Having nameMatched and hostMatched is confusing. Follow the comment and use hostAdded which describes the meaning more clearly. --- cmd/safcm/sync.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/safcm/sync.go b/cmd/safcm/sync.go index 54df9ec..70aaf47 100644 --- a/cmd/safcm/sync.go +++ b/cmd/safcm/sync.go @@ -247,13 +247,13 @@ are only available after the hosts were contacted. nameMatched := make(map[string]bool) // To detect typos we must check all given names but one host can be // matched by multiple names (e.g. two groups with overlapping hosts) - hostMatched := make(map[string]bool) + hostAdded := make(map[string]bool) var res []*config.Host for _, host := range allHosts.List { if nameMap[host.Name] { res = append(res, host) - hostMatched[host.Name] = true + hostAdded[host.Name] = true nameMatched[host.Name] = true } @@ -264,9 +264,9 @@ are only available after the hosts were contacted. } for _, x := range groups { if nameMap[x] { - if !hostMatched[host.Name] { + if !hostAdded[host.Name] { res = append(res, host) - hostMatched[host.Name] = true + hostAdded[host.Name] = true } nameMatched[x] = true } -- 2.43.2