diff --git a/flag_float64.go b/flag_float64.go index 2285547..31f06f3 100644 --- a/flag_float64.go +++ b/flag_float64.go @@ -18,11 +18,11 @@ type Float64Flag struct { Value float64 DefaultText string Destination *float64 - HasBeenSet bool + HasBeenSet bool } // IsSet returns whether or not the flag has been set through env or file -func (f *Float64Flag)IsSet() bool { +func (f *Float64Flag) IsSet() bool { return f.HasBeenSet } diff --git a/flag_timestamp.go b/flag_timestamp.go index 91b4e87..d24edcd 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -8,9 +8,9 @@ import ( // Timestamp wrap to satisfy golang's flag interface. type Timestamp struct { - timestamp *time.Time + timestamp *time.Time hasBeenSet bool - layout string + layout string } // Timestamp constructor @@ -25,6 +25,7 @@ func (t *Timestamp) SetTimestamp(value time.Time) { t.hasBeenSet = true } } + // Set the timestamp string layout for future parsing func (t *Timestamp) SetLayout(layout string) { t.layout = layout @@ -66,7 +67,7 @@ type TimestampFlag struct { FilePath string Required bool Hidden bool - Layout string + Layout string Value *Timestamp DefaultText string HasBeenSet bool diff --git a/help.go b/help.go index aa5947d..c1e974a 100644 --- a/help.go +++ b/help.go @@ -138,7 +138,7 @@ func printFlagSuggestions(lastArg string, flags []Flag, writer io.Writer) { if bflag, ok := flag.(*BoolFlag); ok && bflag.Hidden { continue } - for _, name := range flag.Names(){ + for _, name := range flag.Names() { name = strings.TrimSpace(name) // this will get total count utf8 letters in flag name count := utf8.RuneCountInString(name)