Skip to content

Commit 219a55d

Browse files
committed
Remove FlagsByName
1 parent 9e4783c commit 219a55d

File tree

3 files changed

+0
-38
lines changed

3 files changed

+0
-38
lines changed

flag.go

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,6 @@ var FlagEnvHinter FlagEnvHintFunc = withEnvHint
7373
// details. This is used by the default FlagStringer.
7474
var FlagFileHinter FlagFileHintFunc = withFileHint
7575

76-
// FlagsByName is a slice of Flag.
77-
type FlagsByName []Flag
78-
79-
func (f FlagsByName) Len() int {
80-
return len(f)
81-
}
82-
83-
func (f FlagsByName) Less(i, j int) bool {
84-
if len(f[j].Names()) == 0 {
85-
return false
86-
} else if len(f[i].Names()) == 0 {
87-
return true
88-
}
89-
return lexicographicLess(f[i].Names()[0], f[j].Names()[0])
90-
}
91-
92-
func (f FlagsByName) Swap(i, j int) {
93-
f[i], f[j] = f[j], f[i]
94-
}
95-
9676
// ActionableFlag is an interface that wraps Flag interface and RunAction operation.
9777
type ActionableFlag interface {
9878
RunAction(context.Context, *Command) error

godoc-current.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -769,15 +769,6 @@ var FlagStringer FlagStringFunc = stringifyFlag
769769
FlagStringer converts a flag definition to a string. This is used by help to
770770
display a flag.
771771

772-
type FlagsByName []Flag
773-
FlagsByName is a slice of Flag.
774-
775-
func (f FlagsByName) Len() int
776-
777-
func (f FlagsByName) Less(i, j int) bool
778-
779-
func (f FlagsByName) Swap(i, j int)
780-
781772
type FloatArg = ArgumentBase[float64, NoConfig, floatValue]
782773

783774
type FloatFlag = FlagBase[float64, NoConfig, floatValue]

testdata/godoc-v3.x.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -769,15 +769,6 @@ var FlagStringer FlagStringFunc = stringifyFlag
769769
FlagStringer converts a flag definition to a string. This is used by help to
770770
display a flag.
771771

772-
type FlagsByName []Flag
773-
FlagsByName is a slice of Flag.
774-
775-
func (f FlagsByName) Len() int
776-
777-
func (f FlagsByName) Less(i, j int) bool
778-
779-
func (f FlagsByName) Swap(i, j int)
780-
781772
type FloatArg = ArgumentBase[float64, NoConfig, floatValue]
782773

783774
type FloatFlag = FlagBase[float64, NoConfig, floatValue]

0 commit comments

Comments
 (0)