From e63b0157527fb7d69b4bfcc2716e4eb3ac80f98d Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 17 Apr 2021 08:42:52 +0200 Subject: [PATCH] config: groups: use "member" in "not found" error message "group" was confusing, especially because "group" occurs at the beginning of the error marking the group where the error occurred. --- cmd/safcm/config/groups.go | 2 +- cmd/safcm/config/groups_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/safcm/config/groups.go b/cmd/safcm/config/groups.go index 386a9a7..d003bdd 100644 --- a/cmd/safcm/config/groups.go +++ b/cmd/safcm/config/groups.go @@ -97,7 +97,7 @@ func LoadGroups(cfg *Config, hosts *Hosts) (map[string][]string, error) { if hosts.Map[x] != nil || groups[x] != nil { continue } - return nil, fmt.Errorf("%s group %q not found", + return nil, fmt.Errorf("%s member %q not found", errPrefix, x) } } diff --git a/cmd/safcm/config/groups_test.go b/cmd/safcm/config/groups_test.go index 28aa82f..9f5f046 100644 --- a/cmd/safcm/config/groups_test.go +++ b/cmd/safcm/config/groups_test.go @@ -186,7 +186,7 @@ func TestLoadGroups(t *testing.T) { &Config{}, &Hosts{}, nil, - fmt.Errorf("groups.yaml: group \"1group2\": group \"does-not-exist\" not found"), + fmt.Errorf("groups.yaml: group \"1group2\": member \"does-not-exist\" not found"), }, { "../testdata/group-invalid-name", -- 2.45.2