func (s *EnvironmentsService) ListEnvironments(pid interface{}, opts *ListEnvironmentsOptions, options ...OptionFunc) ([]*Environment, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/environments", url.QueryEscape(project))
	req, err := s.client.NewRequest("GET", u, opts, options)
	if err != nil {
		return nil, nil, err
	}
	var envs []*Environment
	resp, err := s.client.Do(req, &envs)
	if err != nil {
		return nil, resp, err
	}
	return envs, resp, err
}
ListEnvironments gets a list of environments from a project, sorted by name
alphabetically.

GitLab API docs:
https://docs.gitlab.com/ee/api/environments.html#list-environments
package gitlab
import (
	"fmt"
	"net/url"
)
type EnvironmentsService struct {
	client *Client
}
type Environment struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	ExternalURL string `json:"external_url"`
}
func (env Environment) String() string {
	return Stringify(env)
}
type ListEnvironmentsOptions struct {
	ListOptions
}