MCPcopy
hub / github.com/cli/cli / DiscussionClientFunc

Function DiscussionClientFunc

pkg/cmd/discussion/shared/client.go:13–21  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

11// from the given Factory. The returned function is intended to be stored in
12// command Options structs and called lazily inside RunE.
13func 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}

Callers 5

NewCmdViewFunction · 0.92
NewCmdListFunction · 0.92
NewCmdCommentFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdEditFunction · 0.92

Calls 1

NewDiscussionClientFunction · 0.92

Tested by

no test coverage detected