Skip to content

Commit f25ae49

Browse files
committed
update func desc
1 parent 565f23b commit f25ae49

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

docs.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,11 +564,8 @@ func (tabularTemplate) Prettify(s string) string {
564564
return s + "\n" // add an extra newline
565565
}
566566

567-
// getFlagDefaultValue returns the default value of a flag. Previously, the [cli.DocGenerationFlag] interface included
568-
// a GetValue string method, but it was removed in https://github.com/urfave/cli/pull/1988.
569-
// This function serves as a workaround, attempting to retrieve the value using the removed method; if that fails, it
570-
// tries to obtain it via reflection (the [cli.FlagBase] still has a Value field).
571-
// It also checks if there is a DefaultText and if set returns it.
567+
// getFlagDefaultValue returns the default text or default value of a flag.
568+
// cli.BoolFlag will always return an default.
572569
func getFlagDefaultValue(f cli.DocGenerationFlag) (value, text string) {
573570
// GetDefaultText also returns GetValue so we have to use reflection
574571
if ref := reflect.ValueOf(f); ref.Kind() == reflect.Ptr && ref.Elem().Kind() == reflect.Struct {

0 commit comments

Comments
 (0)