From: Simon Ruderich Date: Sat, 17 Apr 2021 06:42:52 +0000 (+0200) Subject: config: groups: use "member" in "not found" error message X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=e63b0157527fb7d69b4bfcc2716e4eb3ac80f98d;p=safcm%2Fsafcm.git 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. --- 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",