cli/pkg/cmd/project/shared/client/client.go
Kynan Ware 82f3b3dfaa Add godoc comments to exported symbols in pkg/cmd/project
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 15:58:15 -07:00

23 lines
605 B
Go

package client
import (
"os"
"github.com/cli/cli/v2/pkg/cmd/project/shared/queries"
"github.com/cli/cli/v2/pkg/cmdutil"
)
// New creates a new project queries client from the given factory.
func New(f *cmdutil.Factory) (*queries.Client, error) {
if f.HttpClient == nil {
// This is for compatibility with tests that exercise Cobra command functionality.
// These tests do not define a `HttpClient` nor do they need to.
return nil, nil
}
httpClient, err := f.HttpClient()
if err != nil {
return nil, err
}
return queries.NewClient(httpClient, os.Getenv("GH_HOST"), f.IOStreams), nil
}