user/group.go
func AddUsersToGroup(name string, members ...string) error {
	if len(members) == 0 {
		return fmt.Errorf("no members to add")
	}
	for i, v := range members {
		if v == "" {
			return EmptyMemberError(fmt.Sprintf("members[%s]", strconv.Itoa(i)))
		}
	}

	// Group
	gr, err := LookupGroup(name)
	if err != nil {
		return err
	}
	if err = _addMembers(&gr.UserList, members...); err != nil {
		return err
	}

	// Shadow group
	sg, err := LookupGShadow(name)
	if err != nil {
		return err
	}
	if err = _addMembers(&sg.UserList, members...); err != nil {
		return err
	}

	// Editing
	if err = edit(name, gr); err != nil {
		return err
	}
	if err = edit(name, sg); err != nil {
		return err
	}

	return nil
}
func AddUsersToGroup(name string, members ...string) error {
	if len(members) == 0 {
		return fmt.Errorf("no members to add")
	}
	for i, v := range members {
		if v == "" {
			return EmptyMemberError(fmt.Sprintf("members[%s]", strconv.Itoa(i)))
		}
	}

	// Group
	gr, err := LookupGroup(name)
	if err != nil {
		return err
	}
	if err = _addMembers(&gr.UserList, members...); err != nil {
		return err
	}

	// Shadow group
	sg, err := LookupGShadow(name)
	if err != nil {
		return err
	}
	if err = _addMembers(&sg.UserList, members...); err != nil {
		return err
	}

	// Editing
	if err = edit(name, gr); err != nil {
		return err
	}
	if err = edit(name, sg); err != nil {
		return err
	}

	return nil
}
// AddUsersToGroup adds the members to a group.