Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ type notExistErrorMessageType int

const (
flagNotExistMessage notExistErrorMessageType = iota
flagNotDefinedMessage
flagNoSuchFlagMessage
flagUnknownFlagMessage
flagUnknownShorthandFlagMessage
Expand All @@ -30,9 +29,6 @@ func (e *NotExistError) Error() string {
case flagNotExistMessage:
return fmt.Sprintf("flag %q does not exist", e.name)

case flagNotDefinedMessage:
return fmt.Sprintf("flag accessed but not defined: %s", e.name)

case flagNoSuchFlagMessage:
return fmt.Sprintf("no such flag -%v", e.name)

Expand Down
2 changes: 1 addition & 1 deletion flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ func (f *FlagSet) lookup(name NormalizedName) *Flag {
func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) {
flag := f.Lookup(name)
if flag == nil {
err := &NotExistError{name: name, messageType: flagNotDefinedMessage}
err := &NotExistError{name: name, messageType: flagNotExistMessage}
return nil, err
}

Expand Down
Loading