Skip to content

Commit 9dceba6

Browse files
Format code.
1 parent 33b1441 commit 9dceba6

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

gotty/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ func main() {
4141
app.Flags = append(
4242
cliFlags,
4343
&cli.StringFlag{
44-
Name: "config",
45-
Value: "~/.gotty",
46-
Usage: "Config file path",
44+
Name: "config",
45+
Value: "~/.gotty",
46+
Usage: "Config file path",
4747
EnvVars: []string{"GOTTY_CONFIG"},
4848
},
4949
)
@@ -55,7 +55,6 @@ func main() {
5555
exit(fmt.Errorf(msg), 1)
5656
}
5757

58-
5958
utils.ApplyFlags(cliFlags, flagMappings, c, appOptions, backendOptions)
6059

6160
appOptions.EnableBasicAuth = c.IsSet("credential")

gotty/utils/flags.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"reflect"
55
"strings"
66

7-
"github.com/urfave/cli/v2"
87
"github.com/fatih/structs"
8+
"github.com/urfave/cli/v2"
99
)
1010

1111
func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings map[string]string, err error) {
@@ -31,22 +31,21 @@ func GenerateFlags(options ...interface{}) (flags []cli.Flag, mappings map[strin
3131
switch field.Kind() {
3232
case reflect.String:
3333
flags = append(flags, &cli.StringFlag{
34-
Name: flagName,
35-
Value: field.Value().(string),
36-
Usage: flagDescription,
34+
Name: flagName,
35+
Value: field.Value().(string),
36+
Usage: flagDescription,
3737
})
3838
case reflect.Bool:
3939
flags = append(flags, &cli.BoolFlag{
40-
Name: flagName,
41-
Usage: flagDescription,
40+
Name: flagName,
41+
Usage: flagDescription,
4242
EnvVars: []string{envName},
43-
4443
})
4544
case reflect.Int:
4645
flags = append(flags, &cli.IntFlag{
47-
Name: flagName,
48-
Value: field.Value().(int),
49-
Usage: flagDescription,
46+
Name: flagName,
47+
Value: field.Value().(int),
48+
Usage: flagDescription,
5049
EnvVars: []string{envName},
5150
})
5251
}

0 commit comments

Comments
 (0)