Help us shape the future of Go! Take the 2026 Go Developer Survey

cmd

package
v2.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arg added in v2.3.2

type Arg struct {
	Key   string
	Value any
}

type Args

type Args struct {
	In           io.Reader
	Out          io.Writer
	Args         []Arg
	ContextItems map[string]any
}

type Command

type Command struct {
	// contains filtered or unexported fields
}

type Option

type Option func(options *Options)

func WithArgs

func WithArgs(args []Arg) Option

func WithConfig

func WithConfig(key string, cfg any) Option

func WithConfigDefault

func WithConfigDefault(cfg any) Option

func WithContextItems

func WithContextItems(items map[string]any) Option

func WithInput

func WithInput(in io.Reader) Option

func WithOutput

func WithOutput(in io.Writer) Option

func WithTimeout

func WithTimeout(wait time.Duration) Option

type Options

type Options struct {
	// contains filtered or unexported fields
}

type Result

type Result int
const (
	Done Result = iota
	Timeout
)

func StartCommand

func StartCommand(tb testing.TB, ctx context.Context, root *cobra.Command, opts ...Option) Result

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL