DiscussionClientFunc returns a factory function that creates a DiscussionClient from the given Factory. The returned function is intended to be stored in command Options structs and called lazily inside RunE.
(f *cmdutil.Factory)
| 11 | // from the given Factory. The returned function is intended to be stored in |
| 12 | // command Options structs and called lazily inside RunE. |
| 13 | func DiscussionClientFunc(f *cmdutil.Factory) func() (client.DiscussionClient, error) { |
| 14 | return func() (client.DiscussionClient, error) { |
| 15 | httpClient, err := f.HttpClient() |
| 16 | if err != nil { |
| 17 | return nil, err |
| 18 | } |
| 19 | return client.NewDiscussionClient(httpClient), nil |
| 20 | } |
| 21 | } |
no test coverage detected