(f *cmdutil.Factory)
| 8 | ) |
| 9 | |
| 10 | func 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 | } |
no test coverage detected