]> ruderich.org/simon Gitweb - safcm/safcm.git/commitdiff
config: use more explicit variable name in ResolveHostGroups()
authorSimon Ruderich <simon@ruderich.org>
Sun, 9 May 2021 10:31:26 +0000 (12:31 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sun, 9 May 2021 13:18:43 +0000 (15:18 +0200)
cmd/safcm/config/groups.go

index 571f19b7fcb10b5adcd4c5e406d6f22e5b585730..c998fb8a96f44ed2d3f6db7bac7c153214465581 100644 (file)
@@ -131,7 +131,7 @@ func LoadGroups(cfg *Config, hosts *Hosts) (map[string][]string, error) {
 func ResolveHostGroups(host string, groups map[string][]string,
        detectedGroups []string) ([]string, error) {
 
-       const maxDepth = 100
+       const maxRecursionDepth = 100
 
        detectedGroupsMap := make(map[string]bool)
        for _, x := range detectedGroups {
@@ -143,7 +143,7 @@ func ResolveHostGroups(host string, groups map[string][]string,
        // groups).
        var lookup func(string, int) bool
        lookup = func(group string, depth int) bool {
-               if depth > maxDepth {
+               if depth > maxRecursionDepth {
                        cycle = &group
                        return false
                }