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)
| 22 | // factory's HTTP client. Commands store it in their options and call it from |
| 23 | // their run function. |
| 24 | func 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 |