17 lines
405 B
Go
17 lines
405 B
Go
|
package errors
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
type InvalidFlagValueError struct {
|
||
|
flag string
|
||
|
invalidValue string
|
||
|
}
|
||
|
|
||
|
func (e *InvalidFlagValueError) Error() string {
|
||
|
return fmt.Sprintf("invalid value '%s' for flag --%s", e.invalidValue, e.flag)
|
||
|
}
|
||
|
|
||
|
func NewInvalidFlagValueError(flag string, invalidValue string) *InvalidFlagValueError {
|
||
|
return &InvalidFlagValueError{flag: flag, invalidValue: invalidValue}
|
||
|
}
|