client.go
func (c *Client) GetFile(ctx context.Context, endpoint string, params url.Values) (*FileResponse, error) {
	// If the sanitizer is enabled, make sure the requested path is safe.
	if c.sanitizerEnabled {
		err := isPathSafe(endpoint)
		if err != nil {
			return nil, err
		}
	}

	baseUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	baseUrl.RawQuery = params.Encode()
	req, err := http.NewRequest(http.MethodGet, baseUrl.String(), nil)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	c.addAuth(req)
	tracer := c.newTracer()
	tracer.Start(req)
	re, err := c.client.Do(req)
	if err != nil {
		tracer.Done(nil, err)
		return nil, err
	}
	tracer.Done(&Response{code: re.StatusCode}, err)
	return &FileResponse{
		code:    re.StatusCode,
		headers: re.Header,
		body:    re.Body,
	}, nil
}
func (c *Client) GetFile(ctx context.Context, endpoint string, params url.Values) (*FileResponse, error) {
	// If the sanitizer is enabled, make sure the requested path is safe.
	if c.sanitizerEnabled {
		err := isPathSafe(endpoint)
		if err != nil {
			return nil, err
		}
	}

	baseUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	baseUrl.RawQuery = params.Encode()
	req, err := http.NewRequest(http.MethodGet, baseUrl.String(), nil)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	c.addAuth(req)
	tracer := c.newTracer()
	tracer.Start(req)
	re, err := c.client.Do(req)
	if err != nil {
		tracer.Done(nil, err)
		return nil, err
	}
	tracer.Done(&Response{code: re.StatusCode}, err)
	return &FileResponse{
		code:    re.StatusCode,
		headers: re.Header,
		body:    re.Body,
	}, nil
}
// GetFile executes get request and returns a file like object
//
// f, err := c.GetFile("files", "report.txt") // returns "/v1/files/report.txt"
//