MCPcopy
hub / github.com/cli/cli / New

Function New

pkg/cmd/project/shared/client/client.go:10–22  ·  view source on GitHub ↗
(f *cmdutil.Factory)

Source from the content-addressed store, hash-verified

8)
9
10func New(f *cmdutil.Factory) (*queries.Client, error) {
11 if f.HttpClient == nil {
12 // This is for compatibility with tests that exercise Cobra command functionality.
13 // These tests do not define a `HttpClient` nor do they need to.
14 return nil, nil
15 }
16
17 httpClient, err := f.HttpClient()
18 if err != nil {
19 return nil, err
20 }
21 return queries.NewClient(httpClient, os.Getenv("GH_HOST"), f.IOStreams), nil
22}

Callers 15

NewCmdCloseFunction · 0.92
NewCmdLinkFunction · 0.92
NewCmdCopyFunction · 0.92
NewCmdMarkTemplateFunction · 0.92
NewCmdDeleteFieldFunction · 0.92
NewCmdListFunction · 0.92
NewCmdDeleteFunction · 0.92
NewCmdViewFunction · 0.92
NewCmdCreateFieldFunction · 0.92
NewCmdDeleteItemFunction · 0.92
NewCmdAddItemFunction · 0.92
NewCmdListFunction · 0.92

Calls 1

NewClientFunction · 0.92

Tested by

no test coverage detected