Skip to content

Commit

Permalink
style: Fixing golangci lint stuff
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed May 9, 2024
1 parent 57ad170 commit b0cdac7
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
32 changes: 16 additions & 16 deletions flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"
)

// String creates a string flag
// String creates a string flag.
func String(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string, value string, overrides []Override) *string {
output := new(string)

Expand All @@ -18,7 +18,7 @@ func String(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env str
return output
}

// StringVar bind a string flag
// StringVar bind a string flag.
func StringVar(fs *flag.FlagSet, output *string, prefix, docPrefix, name, shorthand, label, env string, value string, overrides []Override) {
flagName, envName, usage := computeDescription(fs, prefix, docPrefix, name, label, env)

Expand All @@ -33,7 +33,7 @@ func StringVar(fs *flag.FlagSet, output *string, prefix, docPrefix, name, shorth
fs.StringVar(output, firstLowerCase(flagName), initialValue, usage)
}

// Int creates an int flag
// Int creates an int flag.
func Int(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string, value int, overrides []Override) *int {
output := new(int)

Expand All @@ -42,7 +42,7 @@ func Int(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string
return output
}

// IntVar bind an int flag
// IntVar bind an int flag.
func IntVar(fs *flag.FlagSet, output *int, prefix, docPrefix, name, shorthand, label, env string, value int, overrides []Override) {
flagName, envName, usage := computeDescription(fs, prefix, docPrefix, name, label, env)

Expand All @@ -58,7 +58,7 @@ func IntVar(fs *flag.FlagSet, output *int, prefix, docPrefix, name, shorthand, l
fs.IntVar(output, firstLowerCase(flagName), initialValue, usage)
}

// Int64 creates an int64 flag
// Int64 creates an int64 flag.
func Int64(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string, value int64, overrides []Override) *int64 {
output := new(int64)

Expand All @@ -67,7 +67,7 @@ func Int64(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env stri
return output
}

// Int64Var bind an int64 flag
// Int64Var bind an int64 flag.
func Int64Var(fs *flag.FlagSet, output *int64, prefix, docPrefix, name, shorthand, label, env string, value int64, overrides []Override) {
flagName, envName, usage := computeDescription(fs, prefix, docPrefix, name, label, env)

Expand All @@ -82,7 +82,7 @@ func Int64Var(fs *flag.FlagSet, output *int64, prefix, docPrefix, name, shorthan
fs.Int64Var(output, firstLowerCase(flagName), initialValue, usage)
}

// Uint creates an uint flag
// Uint creates an uint flag.
func Uint(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string, value uint, overrides []Override) *uint {
output := new(uint)

Expand All @@ -91,7 +91,7 @@ func Uint(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env strin
return output
}

// UintVar bind an uint flag
// UintVar bind an uint flag.
func UintVar(fs *flag.FlagSet, output *uint, prefix, docPrefix, name, shorthand, label, env string, value uint, overrides []Override) {
flagName, envName, usage := computeDescription(fs, prefix, docPrefix, name, label, env)

Expand All @@ -107,7 +107,7 @@ func UintVar(fs *flag.FlagSet, output *uint, prefix, docPrefix, name, shorthand,
fs.UintVar(output, firstLowerCase(flagName), initialValue, usage)
}

// Uint64 creates an uint64 flag
// Uint64 creates an uint64 flag.
func Uint64(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string, value uint64, overrides []Override) *uint64 {
output := new(uint64)

Expand All @@ -116,7 +116,7 @@ func Uint64(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env str
return output
}

// Uint64Var binds an uint64 flag
// Uint64Var binds an uint64 flag.
func Uint64Var(fs *flag.FlagSet, output *uint64, prefix, docPrefix, name, shorthand, label, env string, value uint64, overrides []Override) {
flagName, envName, usage := computeDescription(fs, prefix, docPrefix, name, label, env)

Expand All @@ -131,7 +131,7 @@ func Uint64Var(fs *flag.FlagSet, output *uint64, prefix, docPrefix, name, shorth
fs.Uint64Var(output, firstLowerCase(flagName), initialValue, usage)
}

// Float64 creates a float64 flag
// Float64 creates a float64 flag.
func Float64(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string, value float64, overrides []Override) *float64 {
output := new(float64)

Expand All @@ -140,7 +140,7 @@ func Float64(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env st
return output
}

// Float64Var binds a float64 flag
// Float64Var binds a float64 flag.
func Float64Var(fs *flag.FlagSet, output *float64, prefix, docPrefix, name, shorthand, label, env string, value float64, overrides []Override) {
flagName, envName, usage := computeDescription(fs, prefix, docPrefix, name, label, env)

Expand All @@ -155,7 +155,7 @@ func Float64Var(fs *flag.FlagSet, output *float64, prefix, docPrefix, name, shor
fs.Float64Var(output, firstLowerCase(flagName), initialValue, usage)
}

// Bool creates a bool flag
// Bool creates a bool flag.
func Bool(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string, value bool, overrides []Override) *bool {
output := new(bool)

Expand All @@ -164,7 +164,7 @@ func Bool(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env strin
return output
}

// BoolVar binds a bool flag
// BoolVar binds a bool flag.
func BoolVar(fs *flag.FlagSet, output *bool, prefix, docPrefix, name, shorthand, label, env string, value bool, overrides []Override) {
flagName, envName, usage := computeDescription(fs, prefix, docPrefix, name, label, env)

Expand All @@ -177,7 +177,7 @@ func BoolVar(fs *flag.FlagSet, output *bool, prefix, docPrefix, name, shorthand,
fs.BoolVar(output, firstLowerCase(flagName), initialValue, usage)
}

// Duration creates a duration flag
// Duration creates a duration flag.
func Duration(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env string, value time.Duration, overrides []Override) *time.Duration {
output := new(time.Duration)

Expand All @@ -186,7 +186,7 @@ func Duration(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env s
return output
}

// DurationVar binds a duration flag
// DurationVar binds a duration flag.
func DurationVar(fs *flag.FlagSet, output *time.Duration, prefix, docPrefix, name, shorthand, label, env string, value time.Duration, overrides []Override) {
flagName, envName, usage := computeDescription(fs, prefix, docPrefix, name, label, env)

Expand Down
4 changes: 2 additions & 2 deletions override.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package flags

import "strings"

// Override is an override of default value
// Override is an override of default value.
type Override struct {
value any
name string
}

// NewOverride create a default override value
// NewOverride create a default override value.
func NewOverride(name string, value any) Override {
return Override{
name: name,
Expand Down
8 changes: 4 additions & 4 deletions slices.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (i *stringSlice) Set(value string) error {
return nil
}

// StringSlice creates a string slice flag
// StringSlice creates a string slice flag.
func StringSlice(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env, envSeparator string, values []string, overrides []Override) *[]string {
output := new([]string)

Expand All @@ -51,7 +51,7 @@ func StringSlice(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, en
return output
}

// StringSliceVar binds a string slice flag
// StringSliceVar binds a string slice flag.
func StringSliceVar(fs *flag.FlagSet, output *[]string, prefix, docPrefix, name, shorthand, label, env, envSeparator string, values []string, overrides []Override) {
flagName, envName := getNameAndEnv(fs, firstUpperCase(prefix), name, env)
usage := formatLabel(prefix, docPrefix, label, envName) + fmt.Sprintf(", as a `string slice`, environment variable separated by %q", envSeparator)
Expand Down Expand Up @@ -122,7 +122,7 @@ func (i *float64Slice) Set(value string) error {
return nil
}

// Float64Slice creates a string slice flag
// Float64Slice creates a string slice flag.
func Float64Slice(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, env, envSeparator string, values []float64, overrides []Override) *[]float64 {
output := new([]float64)

Expand All @@ -131,7 +131,7 @@ func Float64Slice(fs *flag.FlagSet, prefix, docPrefix, name, shorthand, label, e
return output
}

// Float64SliceVar binds a string slice flag
// Float64SliceVar binds a string slice flag.
func Float64SliceVar(fs *flag.FlagSet, output *[]float64, prefix, docPrefix, name, shorthand, label, env, envSeparator string, values []float64, overrides []Override) {
flagName, envName := getNameAndEnv(fs, firstUpperCase(prefix), name, env)
usage := formatLabel(prefix, docPrefix, label, envName) + fmt.Sprintf(", as a `float64 slice`, environment variable separated by %q", envSeparator)
Expand Down

0 comments on commit b0cdac7

Please sign in to comment.