MCPcopy Create free account
hub / github.com/cli/cli / ClientFunc

Function ClientFunc

pkg/cmd/issue/artifact/shared/shared.go:24–32  ·  view source on GitHub ↗

ClientFunc returns a function that creates an ArtifactClient from the factory's HTTP client. Commands store it in their options and call it from their run function.

(f *cmdutil.Factory)

Source from the content-addressed store, hash-verified

22// factory's HTTP client. Commands store it in their options and call it from
23// their run function.
24func ClientFunc(f *cmdutil.Factory) func() (client.ArtifactClient, error) {
25 return func() (client.ArtifactClient, error) {
26 httpClient, err := f.HttpClient()
27 if err != nil {
28 return nil, err
29 }
30 return client.NewArtifactClient(httpClient), nil
31 }
32}
33
34// ParseIssueArg reads an {<issue-number> | <issue-url>} argument the way other
35// gh issue commands do, and returns the issue number and the function that

Callers 7

NewCmdDeleteFunction · 0.92
NewCmdViewFunction · 0.92
NewCmdListFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdDownloadFunction · 0.92
NewCmdEditFunction · 0.92
TestClientFuncFunction · 0.85

Calls 1

NewArtifactClientFunction · 0.92

Tested by 1

TestClientFuncFunction · 0.68