MCPcopy Create free account
hub / github.com/docker/cli / main

Function main

e2e/cli-plugins/plugins/nopersistentprerun/main.go:13–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11)
12
13func main() {
14 plugin.Run(func(dockerCli command.Cli) *cobra.Command {
15 return &cobra.Command{
16 Use: "nopersistentprerun",
17 Short: "Testing without PersistentPreRun hooks",
18 // PersistentPreRunE: Not specified, we need to test that it works in the absence of an explicit call
19 RunE: func(cmd *cobra.Command, args []string) error {
20 cli := dockerCli.Client()
21 ping, err := cli.Ping(cmd.Context(), client.PingOptions{})
22 if err != nil {
23 return err
24 }
25 fmt.Println(ping.APIVersion)
26 return nil
27 },
28 }
29 },
30 metadata.Metadata{
31 SchemaVersion: "0.1.0",
32 Vendor: "Docker Inc.",
33 Version: "testing",
34 })
35}

Callers

nothing calls this directly

Calls 3

PrintlnMethod · 0.80
ClientMethod · 0.65
PingMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…