func()

in pkg/client/sonar/group.go [37:50]


func (sc *Client) GetGroup(ctx context.Context, groupName string) (*Group, error) {
	groups, err := sc.SearchGroups(ctx, groupName)
	if err != nil {
		return nil, fmt.Errorf("failed to search for groups: %w", err)
	}

	for _, g := range groups {
		if g.Name == groupName {
			return &g, nil
		}
	}

	return nil, NewHTTPError(http.StatusNotFound, fmt.Sprintf("group %s not found", groupName))
}