Skip to content

Commit

Permalink
removing javaish code
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Jul 24, 2023
1 parent 1115d2a commit 9ad0a8d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions goflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func (flagSet *FlagSet) usageFunc() {
}

// If there is a custom help text specified, print it
if isNotBlank(flagSet.customHelpText) {
if !isEmpty(flagSet.customHelpText) {
fmt.Fprintf(cliOutput, "\n%s\n", flagSet.customHelpText)
}
}
Expand Down Expand Up @@ -651,10 +651,6 @@ func (u *uniqueDeduper) isUnique(data *FlagData) bool {
return true
}

func isNotBlank(value string) bool {
return len(strings.TrimSpace(value)) != 0
}

func createUsageString(data *FlagData, currentFlag *flag.Flag) string {
valueType := reflect.TypeOf(currentFlag.Value)

Expand Down Expand Up @@ -713,7 +709,7 @@ func createUsageFlagNames(data *FlagData) string {

var validFlags []string
addValidParam := func(value string) {
if isNotBlank(value) {
if !isEmpty(value) {
validFlags = append(validFlags, fmt.Sprintf("-%s", value))
}
}
Expand Down

0 comments on commit 9ad0a8d

Please sign in to comment.