INNER CODE UNIT · Go

RootCmd

docker/cli · e2e/cli-plugins/plugins/presocket/main.go:24

func RootCmd(dockerCli command.Cli) *cobra.Command {
	cmd := cobra.Command{
		Use:   "presocket",
		Short: "testing plugin that does not connect to the socket",
		// override PersistentPreRunE so that the plugin default
		// PersistentPreRunE doesn't run, simulating a plugin built
		// with a pre-socket-communication version of the CLI
		PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
			return nil
		},
	}

	cmd.AddCommand(&cobra.Command{
		Use:   "test-no-socket",
		Short: "test command that runs until it receives a SIGINT",
		RunE: func(cmd *cobra.Command, args []string) error {
			go func() {
				<-cmd.Context().Done()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…