func GetGroupDetails(svc *iam.Client) []IAMGroup {
	resp, err := svc.ListGroups(context.TODO(), &iam.ListGroupsInput{})
	if err != nil {
		panic(err)
	}
	c := make(chan IAMGroup)
	grouplist := make([]IAMGroup, len(resp.Groups))
	for _, group := range resp.Groups {
		go func(group types.Group) {
			groupStruct := IAMGroup{
				Name:  *group.GroupName,
				Group: &group,
			}
			groupStruct.InlinePolicies = GetGroupPoliciesMapForGroups([]string{*group.GroupName}, svc)
			groupStruct.AttachedPolicies = GetAttachedPoliciesMapForGroups([]string{*group.GroupName}, svc)
			groupStruct.Users = getAllUsersInGroup(*group.GroupName, svc)
			c <- groupStruct
		}(group)
	}
	for i := 0; i < len(resp.Groups); i++ {
		grouplist[i] = <-c
	}
	return grouplist
}
// GetGroupDetails collects detailed information about a group, consisting mostly
// of the users and policies it follows.
GetGroupDetails collects detailed information about a group, consisting mostly
of the users and policies it follows.
// GetGroupDetails collects detailed information about a group consisting mostly // of the users and policies it follows .
func GetGroupDetails(svc *iam.Client) []IAMGroup {
	resp, err := svc.ListGroups(context.TODO(), &iam.ListGroupsInput{})
	if err != nil {
		panic(err)
	}
	c := make(chan IAMGroup)
	grouplist := make([]IAMGroup, len(resp.Groups))
	for _, group := range resp.Groups {
		go func(group types.Group) {
			groupStruct := IAMGroup{
				Name:  *group.GroupName,
				Group: &group,
			}
			groupStruct.InlinePolicies = GetGroupPoliciesMapForGroups([]string{*group.GroupName}, svc)
			groupStruct.AttachedPolicies = GetAttachedPoliciesMapForGroups([]string{*group.GroupName}, svc)
			groupStruct.Users = getAllUsersInGroup(*group.GroupName, svc)
			c <- groupStruct
		}(group)
	}
	for i := 0; i < len(resp.Groups); i++ {
		grouplist[i] = <-c
	}
	return grouplist
}
func GetGroupDetails ( svc * iam . Client ) [ ] IAMGroup { resp , err := svc . ListGroups ( context . TODO ( ) , & iam . ListGroupsInput { } ) if err != nil { panic ( err ) } c := make ( chan IAMGroup ) grouplist := make ( [ ] IAMGroup , len ( resp . Groups ) ) for _ , group := range resp . Groups { go func ( group types . Group ) { groupStruct := IAMGroup { Name : * group . GroupName , Group : & group , } groupStruct . InlinePolicies = GetGroupPoliciesMapForGroups ( [ ] string { * group . GroupName } , svc ) groupStruct . AttachedPolicies = GetAttachedPoliciesMapForGroups ( [ ] string { * group . GroupName } , svc ) groupStruct . Users = getAllUsersInGroup ( * group . GroupName , svc ) c <- groupStruct } ( group ) } for i := 0 ; i < len ( resp . Groups ) ; i ++ { grouplist [ i ] = <- c } return grouplist }
GetGroupDetails collects detailed information about a group, consisting mostly
of the users and policies it follows.
GetGroupDetails collects detailed information about a group consisting mostly of the users and policies it follows .