Documentation ¶
Index ¶
Constants ¶
const ErrInvalidArguments = InvalidArguments("invalid arguments")
ErrInvalidArguments is a simple default for the InvalidArguments type.
Variables ¶
This section is empty.
Functions ¶
func IsInvalidArguments ¶
IsInvalidArguments returns a boolean indicating whether the error is of type InvalidArguments, or wraps an error of that type.
Types ¶
type Command ¶
type Command struct { // The command name. Name string // UsageLine is the one-line usage message. UsageLine string // Short is the short description shown in the 'whatsnew help' output. Short string // Long is the long message shown in the 'whatsnew help <this-command>' // output. Long string // Run runs the command. // // The args are the arguments after the command name. Run func(ctx context.Context, conf *config.Config, args []string) error }
A Command is an implementation of a whatsnew command.
type InvalidArguments ¶
type InvalidArguments string
InvalidArguments is an error type generally indicating incorrect or missing arguments or flags.
An error of this type can be returned from Command.Run for telling the caller that the arguments are incorrect.
It is implemented as a simple string, so that a custom message can be easily represented. If no specific message is required, ErrInvalidArguments might provide a convenient default.
func (InvalidArguments) Error ¶
func (err InvalidArguments) Error() string
Error satisfies the error interface. It simply returns the underlying string value.