func (c *Client) ListVersions(ctx context.Context, modulePath string) ([]string, error) {
	escapedPath, err := module.EscapePath(modulePath)
	if err != nil {
		return nil, fmt.Errorf("module.EscapePath(%q): %w", modulePath, derrors.InvalidArgument)
	}
	u := fmt.Sprintf("%s/%s/@v/list", c.url, escapedPath)
	var versions []string
	collect := func(body io.Reader) error {
		scanner := bufio.NewScanner(body)
		for scanner.Scan() {
			versions = append(versions, scanner.Text())
		}
		return scanner.Err()
	}
	if err := c.executeRequest(ctx, u, collect); err != nil {
		return nil, err
	}
	return versions, nil
}
// ListVersions makes a request to $GOPROXY/<path>/@v/list and returns the
// resulting version strings.
ListVersions makes a request to $GOPROXY//@v/list and returns the
resulting version strings.
// ListVersions makes a request to $GOPROXY / <path > / @v / list and returns the // resulting version strings .
func (c *Client) ListVersions(ctx context.Context, modulePath string) ([]string, error) {
	escapedPath, err := module.EscapePath(modulePath)
	if err != nil {
		return nil, fmt.Errorf("module.EscapePath(%q): %w", modulePath, derrors.InvalidArgument)
	}
	u := fmt.Sprintf("%s/%s/@v/list", c.url, escapedPath)
	var versions []string
	collect := func(body io.Reader) error {
		scanner := bufio.NewScanner(body)
		for scanner.Scan() {
			versions = append(versions, scanner.Text())
		}
		return scanner.Err()
	}
	if err := c.executeRequest(ctx, u, collect); err != nil {
		return nil, err
	}
	return versions, nil
}
func ( c * Client ) ListVersions ( ctx context . Context , modulePath string ) ( [ ] string , error ) { escapedPath , err := module . EscapePath ( modulePath ) if err != nil { return nil , fmt . Errorf ( " " , modulePath , derrors . InvalidArgument ) } u := fmt . Sprintf ( " " , c . url , escapedPath ) var versions [ ] string collect := func ( body io . Reader ) error { scanner := bufio . NewScanner ( body ) for scanner . Scan ( ) { versions = append ( versions , scanner . Text ( ) ) } return scanner . Err ( ) } if err := c . executeRequest ( ctx , u , collect ) ; err != nil { return nil , err } return versions , nil }
ListVersions makes a request to $GOPROXY//@v/list and returns the
resulting version strings.
ListVersions makes a request to $GOPROXY // @v / list and returns the resulting version strings .