Skip to content

Commit c3cf990

Browse files
committed
fix(workflow-cli): lint error
2 parents a97022a + dafcf0d commit c3cf990

11 files changed

Lines changed: 73 additions & 78 deletions

File tree

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ go 1.24
55
require (
66
github.com/chai2010/gettext-go v1.0.3
77
github.com/containerd/console v1.0.4
8-
github.com/drycc/controller-sdk-go v0.0.0-20250326034724-1dafccaadf6b
9-
github.com/drycc/pkg v0.0.0-20241223062248-04810c5faa4b
8+
github.com/drycc/controller-sdk-go v0.0.0-20250403055121-5e021ebe1910
9+
github.com/drycc/pkg v0.0.0-20250324060552-65752139ab2f
1010
github.com/minio/selfupdate v0.6.0
1111
github.com/olekukonko/tablewriter v0.0.5
1212
github.com/schollz/progressbar/v3 v3.18.0
1313
github.com/spf13/cobra v1.9.1
1414
github.com/stretchr/testify v1.10.0
15-
golang.org/x/net v0.36.0
15+
golang.org/x/net v0.39.0
1616
gopkg.in/yaml.v3 v3.0.1
1717
k8s.io/klog/v2 v2.130.1
1818
sigs.k8s.io/yaml v1.4.0
@@ -21,7 +21,7 @@ require (
2121
require (
2222
aead.dev/minisign v0.3.0 // indirect
2323
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
24-
github.com/go-logr/logr v1.4.1 // indirect
24+
github.com/go-logr/logr v1.4.2 // indirect
2525
github.com/google/go-cmp v0.6.0 // indirect
2626
github.com/inconshreveable/mousetrap v1.1.0 // indirect
2727
github.com/kr/pretty v0.3.1 // indirect
@@ -30,7 +30,7 @@ require (
3030
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
3131
github.com/rivo/uniseg v0.4.7 // indirect
3232
github.com/spf13/pflag v1.0.6 // indirect
33-
golang.org/x/crypto v0.35.0 // indirect
34-
golang.org/x/sys v0.30.0 // indirect
35-
golang.org/x/term v0.29.0 // indirect
33+
golang.org/x/crypto v0.37.0 // indirect
34+
golang.org/x/sys v0.32.0 // indirect
35+
golang.org/x/term v0.31.0 // indirect
3636
)

go.sum

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6N
1111
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1212
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
1313
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
14-
github.com/drycc/controller-sdk-go v0.0.0-20250326034724-1dafccaadf6b h1:IA4sT1t/x/JtUm6F6T7j66ETAXwikYaUuNoQMmVp5ew=
15-
github.com/drycc/controller-sdk-go v0.0.0-20250326034724-1dafccaadf6b/go.mod h1:m4nhGeLJvR9bWuF12XhJ1c+hvkVY27OPN48F3l+AvAI=
16-
github.com/drycc/pkg v0.0.0-20241223062248-04810c5faa4b h1:wSIZheOVyeakCpI1i6xDta9e5YLZgNCqw7JfxC6R5MA=
17-
github.com/drycc/pkg v0.0.0-20241223062248-04810c5faa4b/go.mod h1:upGcZF/RCEqidGjSnWHh/txRC1I4GPsRGvF8/+bDfwU=
18-
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
19-
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
14+
github.com/drycc/controller-sdk-go v0.0.0-20250403055121-5e021ebe1910 h1:VIfWljt6ilB8B09GY74oe7tjokZTWwIMQ3zNwDa0DoM=
15+
github.com/drycc/controller-sdk-go v0.0.0-20250403055121-5e021ebe1910/go.mod h1:MbFxGlgRQUaVlThbn3DmB06EJsf+e3/O+qgbWmdvtoE=
16+
github.com/drycc/pkg v0.0.0-20250324060552-65752139ab2f h1:/OV4bY2yQDu0mg3l5wdJG6d2tal1hbSX+uI5eiQBQ4o=
17+
github.com/drycc/pkg v0.0.0-20250324060552-65752139ab2f/go.mod h1:Ss0KonBbfmUVv4bdL+8QAhLtzuBik7DS5tJTMAhycaI=
18+
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
19+
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
2020
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2121
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
2222
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -55,25 +55,25 @@ github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf
5555
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
5656
golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
5757
golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
58-
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
59-
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
58+
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
59+
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
6060
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
6161
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
62-
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
63-
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
62+
golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
63+
golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
6464
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
6565
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6666
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6767
golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6868
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6969
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
7070
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
71-
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
72-
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
71+
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
72+
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
7373
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
7474
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
75-
golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=
76-
golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s=
75+
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
76+
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
7777
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
7878
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
7979
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

internal/commands/autoscale.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (d *DryccCmd) AutoscaleList(appID string) error {
3939
}
4040

4141
// AutoscaleSet sets autoscale options for the app.
42-
func (d *DryccCmd) AutoscaleSet(appID string, ptype string, min int, max int, CPUPercent int) error {
42+
func (d *DryccCmd) AutoscaleSet(appID string, ptype string, minCPU int, maxCPU int, CPUPercent int) error {
4343
appID, s, err := utils.LoadAppSettings(d.ConfigFile, appID)
4444

4545
if err != nil {
@@ -51,8 +51,8 @@ func (d *DryccCmd) AutoscaleSet(appID string, ptype string, min int, max int, CP
5151
quit := progress(d.WOut)
5252
data := map[string]*api.Autoscale{
5353
ptype: {
54-
Min: min,
55-
Max: max,
54+
Min: minCPU,
55+
Max: maxCPU,
5656
CPUPercent: CPUPercent,
5757
},
5858
}

internal/completion/completion.go

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,9 @@ func (c *CertDomainTachCompletion) CompletionFunc(cmd *cobra.Command, args []str
8383
if len(args) == 0 {
8484
certCompletion := CertCompletion{AppID: c.AppID, ConfigFile: c.ConfigFile}
8585
return certCompletion.CompletionFunc(cmd, args, toComplete)
86-
} else {
87-
domainCompletion := DomainCompletion{AppID: c.AppID, ArgsLen: 1, ConfigFile: c.ConfigFile}
88-
return domainCompletion.CompletionFunc(cmd, args, toComplete)
8986
}
87+
domainCompletion := DomainCompletion{AppID: c.AppID, ArgsLen: 1, ConfigFile: c.ConfigFile}
88+
return domainCompletion.CompletionFunc(cmd, args, toComplete)
9089
}
9190

9291
type ConfigPtsGroupArgsCompletion struct {
@@ -98,20 +97,19 @@ func (c *ConfigPtsGroupArgsCompletion) CompletionFunc(cmd *cobra.Command, args [
9897
if len(args) == 0 {
9998
ptsCompletion := PtsCompletion{AppID: c.AppID, ConfigFile: c.ConfigFile}
10099
return ptsCompletion.CompletionFunc(cmd, args, toComplete)
101-
} else {
102-
groups := args[1:]
103-
if appID, s, err := utils.LoadAppSettings(*c.ConfigFile, *c.AppID); err == nil {
104-
if config, err := config.List(s.Client, appID, -1); err == nil {
105-
var results []string
106-
for _, value := range config.Values {
107-
if value.Group != "" && strings.HasPrefix(value.Group, toComplete) {
108-
if !slices.Contains(groups, value.Group) && !slices.Contains(results, value.Group) {
109-
results = append(results, value.Group)
110-
}
100+
}
101+
groups := args[1:]
102+
if appID, s, err := utils.LoadAppSettings(*c.ConfigFile, *c.AppID); err == nil {
103+
if config, err := config.List(s.Client, appID, -1); err == nil {
104+
var results []string
105+
for _, value := range config.Values {
106+
if value.Group != "" && strings.HasPrefix(value.Group, toComplete) {
107+
if !slices.Contains(groups, value.Group) && !slices.Contains(results, value.Group) {
108+
results = append(results, value.Group)
111109
}
112110
}
113-
return results, cobra.ShellCompDirectiveNoFileComp
114111
}
112+
return results, cobra.ShellCompDirectiveNoFileComp
115113
}
116114
}
117115
return nil, cobra.ShellCompDirectiveNoFileComp
@@ -123,8 +121,7 @@ type ConfigGroupCompletion struct {
123121
ArgsLen int
124122
}
125123

126-
func (c *ConfigGroupCompletion) CompletionFunc(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
127-
124+
func (c *ConfigGroupCompletion) CompletionFunc(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
128125
if appID, s, err := utils.LoadAppSettings(*c.ConfigFile, *c.AppID); err == nil && (c.ArgsLen < 0 || len(args) == c.ArgsLen) {
129126
if config, err := config.List(s.Client, appID, -1); err == nil {
130127
var results []string
@@ -253,10 +250,9 @@ func (c *HealthChecksCompletion) CompletionFunc(cmd *cobra.Command, args []strin
253250
if len(args) == 0 {
254251
healthTypeCompletion := HealthTypeCompletion{ArgsLen: 0, ConfigFile: c.ConfigFile}
255252
return healthTypeCompletion.CompletionFunc(cmd, args, toComplete)
256-
} else {
257-
probeTypeCompletion := ProbeTypeCompletion{ArgsLen: 1, ConfigFile: c.ConfigFile}
258-
return probeTypeCompletion.CompletionFunc(cmd, args, toComplete)
259253
}
254+
probeTypeCompletion := ProbeTypeCompletion{ArgsLen: 1, ConfigFile: c.ConfigFile}
255+
return probeTypeCompletion.CompletionFunc(cmd, args, toComplete)
260256
}
261257

262258
type ServiceProtocolCompletion struct {
@@ -555,7 +551,7 @@ type ResourcePlanCompletion struct {
555551
ConfigFile *string
556552
}
557553

558-
func (c *ResourcePlanCompletion) CompletionFunc(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
554+
func (c *ResourcePlanCompletion) CompletionFunc(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) {
559555
if s, err := settings.Load(*c.ConfigFile); err == nil && (c.ArgsLen < 0 || len(args) == c.ArgsLen) {
560556
var results []string
561557
if services, _, err := resources.Plans(s.Client, c.Service, -1); err == nil {
@@ -735,15 +731,14 @@ func (c *TagCompletion) CompletionFunc(_ *cobra.Command, args []string, toComple
735731
return nil, cobra.ShellCompDirectiveNoFileComp
736732
}
737733

738-
type TlsActionCompletion struct {
734+
type TLSActionCompletion struct {
739735
ArgsLen int
740736
ConfigFile *string
741737
}
742738

743-
func (c *TlsActionCompletion) CompletionFunc(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
739+
func (c *TLSActionCompletion) CompletionFunc(_ *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
744740
actions := []string{"enable", "disable"}
745741
if c.ArgsLen < 0 || len(args) == c.ArgsLen {
746-
747742
var results []string
748743
for _, action := range actions {
749744
if strings.HasPrefix(action, toComplete) {

internal/parser/autoscale.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ func autoscaleSetCommand(cmdr *commands.DryccCmd) *cobra.Command {
7474
cmd.Flags().IntVarP(&flags.cpuPercent, "cpu-percent", "", 0, i18n.T("Target CPU utilization percentage"))
7575
cmd.Flags().SortFlags = false
7676

77-
must_flags := []string{"min", "max", "cpu-percent"}
78-
for _, must_flag := range must_flags {
79-
cmd.MarkFlagRequired(must_flag)
77+
mustFlags := []string{"min", "max", "cpu-percent"}
78+
for _, mustFlag := range mustFlags {
79+
cmd.MarkFlagRequired(mustFlag)
8080
}
8181

8282
appCompletion := completion.AppCompletion{ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}

internal/parser/gateways.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func NewGatewaysCommand(cmdr *commands.DryccCmd) *cobra.Command {
1212
cmd := &cobra.Command{
1313
Use: "gateways",
1414
Short: i18n.T("Manage gateways for your applications"),
15-
RunE: func(cmd *cobra.Command, args []string) error {
15+
RunE: func(_ *cobra.Command, args []string) error {
1616
results, _ := commands.ResponseLimit(limit)
1717
return cmdr.GatewaysList(app, results)
1818
},
@@ -67,9 +67,9 @@ func gatewaysAdd(cmdr *commands.DryccCmd) *cobra.Command {
6767
cmd.Flags().IntVar(&flags.port, "port", 0, i18n.T("Port is the network port, the listener expects to receive"))
6868
cmd.Flags().StringVarP(&flags.protocol, "protocol", "", "", i18n.T("Protocol specifies the network protocol this listener expects to receive. Supports TCP, UDP, TLS, HTTP, and HTTPS"))
6969

70-
must_flags := []string{"port", "protocol"}
71-
for _, must_flag := range must_flags {
72-
cmd.MarkFlagRequired(must_flag)
70+
mustFlags := []string{"port", "protocol"}
71+
for _, mustFlag := range mustFlags {
72+
cmd.MarkFlagRequired(mustFlag)
7373
}
7474

7575
gatewayProtocolCompletion := completion.GatewayProtocolCompletion{ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}
@@ -100,9 +100,9 @@ func gatewaysRemove(cmdr *commands.DryccCmd) *cobra.Command {
100100
cmd.Flags().IntVar(&flags.port, "port", 0, i18n.T("Port is the network port, the listener received"))
101101
cmd.Flags().StringVarP(&flags.protocol, "protocol", "", "", i18n.T("Protocol specifies the network protocol this listener received"))
102102

103-
must_flags := []string{"port", "protocol"}
104-
for _, must_flag := range must_flags {
105-
cmd.MarkFlagRequired(must_flag)
103+
mustFlags := []string{"port", "protocol"}
104+
for _, mustFlag := range mustFlags {
105+
cmd.MarkFlagRequired(mustFlag)
106106
}
107107

108108
gatewayProtocolCompletion := completion.GatewayProtocolCompletion{ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}

internal/parser/routes.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ func routesAttachCommand(cmdr *commands.DryccCmd) *cobra.Command {
187187
cmd.Flags().StringVar(&flags.gateway, "gateway", "", i18n.T("The unique name of the gaetway"))
188188
cmd.Flags().IntVarP(&flags.port, "port", "", 0, i18n.T("Port is the network port, the gateway listener expects to receive"))
189189

190-
must_flags := []string{"gateway", "port"}
191-
for _, must_flag := range must_flags {
192-
cmd.MarkFlagRequired(must_flag)
190+
mustFlags := []string{"gateway", "port"}
191+
for _, mustFlag := range mustFlags {
192+
cmd.MarkFlagRequired(mustFlag)
193193
}
194194

195195
gatewayNameCompletion := completion.GatewayNameCompletion{AppID: &app, ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}
@@ -223,9 +223,9 @@ func routesDetachCommand(cmdr *commands.DryccCmd) *cobra.Command {
223223
cmd.Flags().StringVar(&flags.gateway, "gateway", "", i18n.T("The unique name of the gaetway"))
224224
cmd.Flags().IntVarP(&flags.port, "port", "", 0, i18n.T("Port is the network port, the gateway listener expects to receive"))
225225

226-
must_flags := []string{"port", "protocol"}
227-
for _, must_flag := range must_flags {
228-
cmd.MarkFlagRequired(must_flag)
226+
mustFlags := []string{"port", "protocol"}
227+
for _, mustFlag := range mustFlags {
228+
cmd.MarkFlagRequired(mustFlag)
229229
}
230230

231231
gatewayNameCompletion := completion.GatewayNameCompletion{AppID: &app, ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}

internal/parser/timeouts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewTimeoutsCommand(cmdr *commands.DryccCmd) *cobra.Command {
1313
cmd := &cobra.Command{
1414
Use: "timeouts",
1515
Short: i18n.T("Manage pods termination grace period"),
16-
RunE: func(cmd *cobra.Command, args []string) error {
16+
RunE: func(_ *cobra.Command, args []string) error {
1717
return cmdr.TimeoutsList(app, version)
1818
},
1919
}

internal/parser/tls.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func tlsInfoCommand(cmdr *commands.DryccCmd) *cobra.Command {
4646
}
4747

4848
func tlsForceCommand(cmdr *commands.DryccCmd) *cobra.Command {
49-
tlsActionCompletion := completion.TlsActionCompletion{ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}
49+
TLSActionCompletion := completion.TLSActionCompletion{ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}
5050
cmd := &cobra.Command{
5151
Use: "force <action>",
5252
Example: template.CustomExample(
@@ -58,7 +58,7 @@ func tlsForceCommand(cmdr *commands.DryccCmd) *cobra.Command {
5858
Args: cobra.ExactArgs(1),
5959
ValidArgs: []string{"enable", "disable"},
6060
Short: i18n.T("Force TLS settings to HTTPS-only redirection"),
61-
ValidArgsFunction: tlsActionCompletion.CompletionFunc,
61+
ValidArgsFunction: TLSActionCompletion.CompletionFunc,
6262
RunE: func(cmd *cobra.Command, args []string) error {
6363
action := args[0]
6464
if action == "enable" {
@@ -74,7 +74,7 @@ func tlsForceCommand(cmdr *commands.DryccCmd) *cobra.Command {
7474
}
7575

7676
func tlsAutoCommand(cmdr *commands.DryccCmd) *cobra.Command {
77-
tlsActionCompletion := completion.TlsActionCompletion{ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}
77+
TLSActionCompletion := completion.TLSActionCompletion{ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}
7878
cmd := &cobra.Command{
7979
Use: "auto <action>",
8080
Example: template.CustomExample(
@@ -86,7 +86,7 @@ func tlsAutoCommand(cmdr *commands.DryccCmd) *cobra.Command {
8686
Args: cobra.ExactArgs(1),
8787
ValidArgs: []string{"enable", "disable"},
8888
Short: i18n.T("Automatic certificate management"),
89-
ValidArgsFunction: tlsActionCompletion.CompletionFunc,
89+
ValidArgsFunction: TLSActionCompletion.CompletionFunc,
9090
RunE: func(cmd *cobra.Command, args []string) error {
9191
action := args[0]
9292
if action == "enable" {
@@ -123,9 +123,9 @@ func tlsIssuerCommand(cmdr *commands.DryccCmd) *cobra.Command {
123123
cmd.Flags().StringVar(&flags.keyID, "key-id", "", i18n.T("CA key ID"))
124124
cmd.Flags().StringVar(&flags.keySecret, "key-secret", "", i18n.T("CA key secret"))
125125

126-
must_flags := []string{"email", "server", "key-id", "key-secret"}
127-
for _, must_flag := range must_flags {
128-
cmd.MarkFlagRequired(must_flag)
126+
mustFlags := []string{"email", "server", "key-id", "key-secret"}
127+
for _, mustFlag := range mustFlags {
128+
cmd.MarkFlagRequired(mustFlag)
129129
}
130130

131131
return cmd

internal/parser/tokens.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ func tokensAddCommand(cmdr *commands.DryccCmd) *cobra.Command {
6767
cmd.Flags().StringVarP(&flags.username, "username", "u", "", i18n.T("Provide a username for the account"))
6868
cmd.Flags().StringVarP(&flags.password, "password", "p", "", i18n.T("Provide a password for the account"))
6969

70-
must_flags := []string{"username", "password"}
71-
for _, must_flag := range must_flags {
72-
cmd.MarkFlagRequired(must_flag)
70+
mustFlags := []string{"username", "password"}
71+
for _, mustFlag := range mustFlags {
72+
cmd.MarkFlagRequired(mustFlag)
7373
}
7474

7575
return cmd

0 commit comments

Comments
 (0)