amalgomated/cmdset.go
func NewCmdWithRunner(cmdName string, runner func()) (*CmdWithRunner, error) {
	if cmdName == "" {
		return nil, errors.New("cmdName cannot be blank")
	}

	for _, r := range cmdName {
		if unicode.IsSpace(r) {
			return nil, errors.Errorf("cmdName cannot contain whitespace: %q", cmdName)
		}
	}

	return &CmdWithRunner{
		cmdName: cmdName,
		runner:  runner,
	}, nil
}
func NewCmdWithRunner(cmdName string, runner func()) (*CmdWithRunner, error) {
	if cmdName == "" {
		return nil, errors.New("cmdName cannot be blank")
	}

	for _, r := range cmdName {
		if unicode.IsSpace(r) {
			return nil, errors.Errorf("cmdName cannot contain whitespace: %q", cmdName)
		}
	}

	return &CmdWithRunner{
		cmdName: cmdName,
		runner:  runner,
	}, nil
}
func NewCmdWithRunner ( cmdName string , runner func ( ) ) ( * CmdWithRunner , error ) { if cmdName == " " { return nil , errors . New ( " " ) } for _ , r := range cmdName { if unicode . IsSpace ( r ) { return nil , errors . Errorf ( " " , cmdName ) } } return & CmdWithRunner { cmdName : cmdName , runner : runner , } , nil }
// NewCmdWithRunner creates a new CmdWithRunner for the provided name and runner. Returns an error if the provided name
// is not a legal command name.
NewCmdWithRunner creates a new CmdWithRunner for the provided name and runner . Returns an error if the provided name is not a legal command name .