func (s *GroupsService) SearchGroup(query string, options ...OptionFunc) ([]*Group, *Response, error) {
	var q struct {
		Search string `url:"search,omitempty" json:"search,omitempty"`
	}
	q.Search = query
	req, err := s.client.NewRequest("GET", "groups", &q, options)
	if err != nil {
		return nil, nil, err
	}
	var g []*Group
	resp, err := s.client.Do(req, &g)
	if err != nil {
		return nil, resp, err
	}
	return g, resp, err
}
SearchGroup get all groups that match your string in their name or path.

GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#search-for-group
package gitlab
import (
	"fmt"
	"net/url"
)
type GroupsService struct {
	client *Client
}
type Group struct {
	ID                   int                `json:"id"`
	Name                 string             `json:"name"`
	Path                 string             `json:"path"`
	Description          string             `json:"description"`
	Visibility           *VisibilityValue   `json:"visibility"`
	LFSEnabled           bool               `json:"lfs_enabled"`
	AvatarURL            string             `json:"avatar_url"`
	WebURL               string             `json:"web_url"`
	RequestAccessEnabled bool               `json:"request_access_enabled"`
	FullName             string             `json:"full_name"`
	FullPath             string             `json:"full_path"`
	ParentID             int                `json:"parent_id"`
	Projects             []*Project         `json:"projects"`
	Statistics           *StorageStatistics `json:"statistics"`
}
type ListGroupsOptions struct {
	ListOptions
	AllAvailable *bool   `url:"all_available,omitempty" json:"all_available,omitempty"`
	OrderBy      *string `url:"order_by,omitempty" json:"order_by,omitempty"`
	Owned        *bool   `url:"owned,omitempty" json:"owned,omitempty"`
	Search       *string `url:"search,omitempty" json:"search,omitempty"`
	Sort         *string `url:"sort,omitempty" json:"sort,omitempty"`
	Statistics   *bool   `url:"statistics,omitempty" json:"statistics,omitempty"`
}
func (s *GroupsService) ListGroups(opt *ListGroupsOptions, options ...OptionFunc) ([]*Group, *Response, error) {
	req, err := s.client.NewRequest("GET", "groups", opt, options)
	if err != nil {
		return nil, nil, err
	}
	var g []*Group
	resp, err := s.client.Do(req, &g)
	if err != nil {
		return nil, resp, err
	}
	return g, resp, err
}
func (s *GroupsService) GetGroup(gid interface{}, options ...OptionFunc) (*Group, *Response, error) {
	group, err := parseID(gid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("groups/%s", url.QueryEscape(group))
	req, err := s.client.NewRequest("GET", u, nil, options)
	if err != nil {
		return nil, nil, err
	}
	g := new(Group)
	resp, err := s.client.Do(req, g)
	if err != nil {
		return nil, resp, err
	}
	return g, resp, err
}
type CreateGroupOptions struct {
	Name                 *string          `url:"name,omitempty" json:"name,omitempty"`
	Path                 *string          `url:"path,omitempty" json:"path,omitempty"`
	Description          *string          `url:"description,omitempty" json:"description,omitempty"`
	Visibility           *VisibilityValue `url:"visibility,omitempty" json:"visibility,omitempty"`
	LFSEnabled           *bool            `url:"lfs_enabled,omitempty" json:"lfs_enabled,omitempty"`
	RequestAccessEnabled *bool            `url:"request_access_enabled,omitempty" json:"request_access_enabled,omitempty"`
	ParentID             *int             `url:"parent_id,omitempty" json:"parent_id,omitempty"`
}
func (s *GroupsService) CreateGroup(opt *CreateGroupOptions, options ...OptionFunc) (*Group, *Response, error) {
	req, err := s.client.NewRequest("POST", "groups", opt, options)
	if err != nil {
		return nil, nil, err
	}
	g := new(Group)
	resp, err := s.client.Do(req, g)
	if err != nil {
		return nil, resp, err
	}
	return g, resp, err
}
func (s *GroupsService) TransferGroup(gid interface{}, project int, options ...OptionFunc) (*Group, *Response, error) {
	group, err := parseID(gid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("groups/%s/projects/%d", url.QueryEscape(group), project)
	req, err := s.client.NewRequest("POST", u, nil, options)
	if err != nil {
		return nil, nil, err
	}
	g := new(Group)
	resp, err := s.client.Do(req, g)
	if err != nil {
		return nil, resp, err
	}
	return g, resp, err
}
type UpdateGroupOptions CreateGroupOptions
func (s *GroupsService) UpdateGroup(gid interface{}, opt *UpdateGroupOptions, options ...OptionFunc) (*Group, *Response, error) {
	group, err := parseID(gid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("groups/%s", url.QueryEscape(group))
	req, err := s.client.NewRequest("PUT", u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	g := new(Group)
	resp, err := s.client.Do(req, g)
	if err != nil {
		return nil, resp, err
	}
	return g, resp, err
}
func (s *GroupsService) DeleteGroup(gid interface{}, options ...OptionFunc) (*Response, error) {
	group, err := parseID(gid)
	if err != nil {
		return nil, err
	}
	u := fmt.Sprintf("groups/%s", url.QueryEscape(group))
	req, err := s.client.NewRequest("DELETE", u, nil, options)
	if err != nil {
		return nil, err
	}
	return s.client.Do(req, nil)
}