Skip to content

Commit 642a465

Browse files
authored
fix(workflow-cli): lint error (#80)
1 parent c97b772 commit 642a465

34 files changed

Lines changed: 171 additions & 173 deletions

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func NewDryccCommand() *cobra.Command {
2525
rootCmd := &cobra.Command{
2626
Use: "drycc",
2727
Short: i18n.T("The Drycc command-line client issues API calls to a Drycc controller"),
28-
PersistentPreRun: func(cmd *cobra.Command, args []string) {
28+
PersistentPreRun: func(_ *cobra.Command, _ []string) {
2929
cmdr = commands.DryccCmd{ConfigFile: flags.config, WOut: os.Stdout, WErr: os.Stderr, WIn: os.Stdin, Location: time.Local}
3030
},
3131
}

internal/completion/completion.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,12 +841,11 @@ func (c *VolumesUnmountCompletion) CompletionFunc(cmd *cobra.Command, args []str
841841
if len(args) == 0 {
842842
volumeCompletion := VolumeCompletion{AppID: c.AppID, ArgsLen: 0, ConfigFile: c.ConfigFile}
843843
return volumeCompletion.CompletionFunc(cmd, args, toComplete)
844-
} else {
845-
ptsArgCompletion := PtsArgsCompletion{
846-
PtsCompletion: &PtsCompletion{AppID: c.AppID, ArgsLen: -1, ConfigFile: c.ConfigFile},
847-
}
848-
return ptsArgCompletion.CompletionFunc(cmd, args, toComplete)
849844
}
845+
ptsArgCompletion := PtsArgsCompletion{
846+
PtsCompletion: &PtsCompletion{AppID: c.AppID, ArgsLen: -1, ConfigFile: c.ConfigFile},
847+
}
848+
return ptsArgCompletion.CompletionFunc(cmd, args, toComplete)
850849
}
851850

852851
type VolumesCmdCompletion struct {

internal/parser/apps.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func NewAppsCommand(cmdr *commands.DryccCmd) *cobra.Command {
1515
cmd := &cobra.Command{
1616
Use: "apps",
1717
Short: i18n.T("Manage applications used to provide services"),
18-
RunE: func(cmd *cobra.Command, args []string) error {
18+
RunE: func(_ *cobra.Command, _ []string) error {
1919
return cmdr.AppsList(limit)
2020
},
2121
}
@@ -43,7 +43,7 @@ func appsCreate(cmdr *commands.DryccCmd) *cobra.Command {
4343
Args: cobra.MaximumNArgs(1),
4444
Short: i18n.T("Create a new application"),
4545
Long: i18n.T(`Creates a new application. If no <id> is provided, one will be generated automatically`),
46-
RunE: func(cmd *cobra.Command, args []string) error {
46+
RunE: func(_ *cobra.Command, args []string) error {
4747
id := ""
4848
if len(args) > 0 {
4949
id = args[0]
@@ -64,7 +64,7 @@ func appsList(cmdr *commands.DryccCmd) *cobra.Command {
6464
Use: "list",
6565
Short: i18n.T("List accessible applications"),
6666
Long: i18n.T("Lists applications visible to the current user"),
67-
RunE: func(cmd *cobra.Command, args []string) error {
67+
RunE: func(_ *cobra.Command, _ []string) error {
6868
return cmdr.AppsList(limit)
6969
},
7070
}
@@ -80,7 +80,7 @@ func appsInfo(cmdr *commands.DryccCmd) *cobra.Command {
8080
Use: "info",
8181
Short: i18n.T("View info about an application"),
8282
Long: i18n.T("Prints info about the current application"),
83-
RunE: func(cmd *cobra.Command, args []string) error {
83+
RunE: func(_ *cobra.Command, _ []string) error {
8484
return cmdr.AppInfo(app)
8585
},
8686
}
@@ -99,7 +99,7 @@ func appsOpen(cmdr *commands.DryccCmd) *cobra.Command {
9999
Use: "open",
100100
Short: i18n.T("Open the application in a browser"),
101101
Long: i18n.T("Opens a URL to the application in the default browser"),
102-
RunE: func(cmd *cobra.Command, args []string) error {
102+
RunE: func(_ *cobra.Command, _ []string) error {
103103
return cmdr.AppOpen(app)
104104
},
105105
}
@@ -124,7 +124,7 @@ func appsLogs(cmdr *commands.DryccCmd) *cobra.Command {
124124
Use: "logs",
125125
Short: i18n.T("Retrieve application log events"),
126126
Long: i18n.T("Retrieves the most recent log events"),
127-
RunE: func(cmd *cobra.Command, args []string) error {
127+
RunE: func(_ *cobra.Command, _ []string) error {
128128
return cmdr.AppLogs(app, flags.lines, flags.follow, flags.timeout)
129129
},
130130
}
@@ -161,7 +161,7 @@ func appsRun(cmdr *commands.DryccCmd) *cobra.Command {
161161
),
162162
Short: i18n.T("Run a command in an ephemeral app container"),
163163
Long: i18n.T("Runs a command inside an ephemeral app container"),
164-
RunE: func(cmd *cobra.Command, args []string) error {
164+
RunE: func(_ *cobra.Command, args []string) error {
165165
command := strings.Join(args, " ")
166166
return cmdr.AppRun(app, command, flags.mounts, flags.timeout, flags.expires)
167167
},
@@ -188,7 +188,7 @@ func appsDestroy(cmdr *commands.DryccCmd) *cobra.Command {
188188
Use: "destroy",
189189
Example: "drycc apps destroy -a <app> --confirm <app>",
190190
Short: i18n.T("Destroy an application"),
191-
RunE: func(cmd *cobra.Command, args []string) error {
191+
RunE: func(_ *cobra.Command, _ []string) error {
192192
return cmdr.AppDestroy(app, flags.confirm)
193193
},
194194
}
@@ -208,7 +208,7 @@ func appsTransfer(cmdr *commands.DryccCmd) *cobra.Command {
208208
Args: cobra.ExactArgs(1),
209209
Short: i18n.T("Transfer app ownership to another user"),
210210
Long: i18n.T("Transfer application ownership to another user."),
211-
RunE: func(cmd *cobra.Command, args []string) error {
211+
RunE: func(_ *cobra.Command, args []string) error {
212212
user := args[0]
213213
return cmdr.AppTransfer(app, user)
214214
},

internal/parser/auth.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func authLogin(cmdr *commands.DryccCmd) *cobra.Command {
3333
Example: "drycc auth login http://drycc.local3.dryccapp.com/",
3434
Short: i18n.T("Authenticate against a controller"),
3535
Long: i18n.T("Logs in by authenticating against a controller"),
36-
RunE: func(cmd *cobra.Command, args []string) error {
36+
RunE: func(_ *cobra.Command, args []string) error {
3737
controller := args[0]
3838
return cmdr.Login(controller, flags.sslVerify, flags.username, flags.password)
3939
},
@@ -52,7 +52,7 @@ func authLogout(cmdr *commands.DryccCmd) *cobra.Command {
5252
Example: "drycc auth logout",
5353
Short: i18n.T("Clear the current user session"),
5454
Long: i18n.T("Logs out from a controller and clears the user session"),
55-
RunE: func(cmd *cobra.Command, args []string) error {
55+
RunE: func(_ *cobra.Command, _ []string) error {
5656
return cmdr.Logout()
5757
},
5858
}
@@ -70,7 +70,7 @@ func authWhoami(cmdr *commands.DryccCmd) *cobra.Command {
7070
Example: "drycc auth whoami",
7171
Short: i18n.T("Display the current user"),
7272
Long: i18n.T("Displays the currently logged in user"),
73-
RunE: func(cmd *cobra.Command, args []string) error {
73+
RunE: func(_ *cobra.Command, _ []string) error {
7474
return cmdr.Whoami(flags.all)
7575
},
7676
}

internal/parser/autodeploy.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewAutodeployCommand(cmdr *commands.DryccCmd) *cobra.Command {
1313
cmd := &cobra.Command{
1414
Use: "autodeploy",
1515
Short: i18n.T("Manage autodeploy if or not for applications"),
16-
RunE: func(cmd *cobra.Command, args []string) error {
16+
RunE: func(_ *cobra.Command, _ []string) error {
1717
return cmdr.AutodeployInfo(app)
1818
},
1919
}
@@ -33,7 +33,7 @@ func autodeployInfo(cmdr *commands.DryccCmd) *cobra.Command {
3333
cmd := &cobra.Command{
3434
Use: "info",
3535
Short: i18n.T("Prints info about the current application's autodeploy if or not"),
36-
RunE: func(cmd *cobra.Command, args []string) error {
36+
RunE: func(_ *cobra.Command, _ []string) error {
3737
return cmdr.AutodeployInfo(app)
3838
},
3939
}
@@ -45,7 +45,7 @@ func autodeployEnable(cmdr *commands.DryccCmd) *cobra.Command {
4545
cmd := &cobra.Command{
4646
Use: "enable",
4747
Short: i18n.T("Enables autodeploy for an app"),
48-
RunE: func(cmd *cobra.Command, args []string) error {
48+
RunE: func(_ *cobra.Command, _ []string) error {
4949
return cmdr.AutodeployEnable(app)
5050
},
5151
}
@@ -57,7 +57,7 @@ func autodeployDisable(cmdr *commands.DryccCmd) *cobra.Command {
5757
cmd := &cobra.Command{
5858
Use: "disable",
5959
Short: i18n.T("Disables autodeploy for an app"),
60-
RunE: func(cmd *cobra.Command, args []string) error {
60+
RunE: func(_ *cobra.Command, _ []string) error {
6161
return cmdr.AutodeployDisable(app)
6262
},
6363
}

internal/parser/autorollback.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func NewAutorollbackCommand(cmdr *commands.DryccCmd) *cobra.Command {
1212
cmd := &cobra.Command{
1313
Use: "autorollback",
1414
Short: i18n.T("Manage autorollback if or not for application"),
15-
RunE: func(_ *cobra.Command, args []string) error {
15+
RunE: func(_ *cobra.Command, _ []string) error {
1616
return cmdr.AutorollbackInfo(app)
1717
},
1818
}
@@ -32,7 +32,7 @@ func autorollbackInfo(cmdr *commands.DryccCmd) *cobra.Command {
3232
Use: "info",
3333
Short: i18n.T("View autorollback info for an application"),
3434
Long: i18n.T("Prints info about the current application's autorollback if or not"),
35-
RunE: func(cmd *cobra.Command, args []string) error {
35+
RunE: func(_ *cobra.Command, _ []string) error {
3636
return cmdr.AutorollbackInfo(app)
3737
},
3838
}
@@ -44,7 +44,7 @@ func autorollbackEnable(cmdr *commands.DryccCmd) *cobra.Command {
4444
cmd := &cobra.Command{
4545
Use: "enable",
4646
Short: i18n.T("Enable autorollback for an application"),
47-
RunE: func(cmd *cobra.Command, args []string) error {
47+
RunE: func(_ *cobra.Command, _ []string) error {
4848
return cmdr.AutorollbackEnable(app)
4949
},
5050
}
@@ -56,7 +56,7 @@ func autorollbackDisable(cmdr *commands.DryccCmd) *cobra.Command {
5656
cmd := &cobra.Command{
5757
Use: "disable",
5858
Short: i18n.T("Disable autorollback for an application"),
59-
RunE: func(cmd *cobra.Command, args []string) error {
59+
RunE: func(_ *cobra.Command, _ []string) error {
6060
return cmdr.AutorollbackDisable(app)
6161
},
6262
}

internal/parser/autoscale.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewAutoscaleCommand(cmdr *commands.DryccCmd) *cobra.Command {
1313
cmd := &cobra.Command{
1414
Use: "autoscale",
1515
Short: i18n.T("Manage autoscale for applications"),
16-
RunE: func(cmd *cobra.Command, args []string) error {
16+
RunE: func(_ *cobra.Command, _ []string) error {
1717
return cmdr.AutoscaleList(app)
1818
},
1919
}
@@ -33,7 +33,7 @@ func autoscaleListCommand(cmdr *commands.DryccCmd) *cobra.Command {
3333
Use: "list",
3434
Short: i18n.T("List autoscale options for an application"),
3535
Long: i18n.T("Prints a list of autoscale options for the application"),
36-
RunE: func(cmd *cobra.Command, args []string) error {
36+
RunE: func(_ *cobra.Command, _ []string) error {
3737
return cmdr.AutoscaleList(app)
3838
},
3939
}
@@ -63,7 +63,7 @@ func autoscaleSetCommand(cmdr *commands.DryccCmd) *cobra.Command {
6363
Short: i18n.T("Turn on autoscale for an app"),
6464
Long: i18n.T("Set autoscale option per process type for an app"),
6565
ValidArgsFunction: ptsArgsCompletion.CompletionFunc,
66-
RunE: func(cmd *cobra.Command, args []string) error {
66+
RunE: func(_ *cobra.Command, args []string) error {
6767
ptype := args[0]
6868
return cmdr.AutoscaleSet(app, ptype, flags.min, flags.max, flags.cpuPercent)
6969
},
@@ -75,8 +75,8 @@ func autoscaleSetCommand(cmdr *commands.DryccCmd) *cobra.Command {
7575
cmd.Flags().SortFlags = false
7676

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

8282
appCompletion := completion.AppCompletion{ArgsLen: -1, ConfigFile: &cmdr.ConfigFile}
@@ -100,7 +100,7 @@ func autoscaleUnsetCommand(cmdr *commands.DryccCmd) *cobra.Command {
100100
Short: i18n.T("Turn off autoscale for an app"),
101101
Long: i18n.T("Unset autoscale per process type for an app"),
102102
ValidArgsFunction: ptsArgsCompletion.CompletionFunc,
103-
RunE: func(cmd *cobra.Command, args []string) error {
103+
RunE: func(_ *cobra.Command, args []string) error {
104104
ptype := args[0]
105105
return cmdr.AutoscaleUnset(app, ptype)
106106
},

internal/parser/builds.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func NewBuildsCommand(cmdr *commands.DryccCmd) *cobra.Command {
1111
cmd := &cobra.Command{
1212
Use: "builds",
1313
Short: i18n.T("Manage builds created using 'git push'"),
14-
RunE: func(cmd *cobra.Command, args []string) error {
14+
RunE: func(_ *cobra.Command, _ []string) error {
1515
return cmdr.BuildsInfo(app, version)
1616
},
1717
}
@@ -45,7 +45,7 @@ func buildsCreate(cmdr *commands.DryccCmd) *cobra.Command {
4545
Long: i18n.T(`Creates a new build of an application. Imports an <image> and deploys it to Drycc
4646
as a new release. If a Procfile or drycc.yaml is present in the current directory,
4747
it will be used as the default for this application.`),
48-
RunE: func(cmd *cobra.Command, args []string) error {
48+
RunE: func(_ *cobra.Command, args []string) error {
4949
image := args[0]
5050
err := cmdr.BuildsCreate(app, image, flags.stack, flags.procfile, flags.dryccPath, flags.confirm)
5151
return err
@@ -72,7 +72,7 @@ func buildsInfo(cmdr *commands.DryccCmd) *cobra.Command {
7272
Use: "info",
7373
Example: "drycc builds info",
7474
Short: i18n.T("Print information about a specific build"),
75-
RunE: func(cmd *cobra.Command, args []string) error {
75+
RunE: func(_ *cobra.Command, _ []string) error {
7676
return cmdr.BuildsInfo(app, version)
7777
},
7878
}
@@ -97,7 +97,7 @@ func buildsFetch(cmdr *commands.DryccCmd) *cobra.Command {
9797
Use: "fetch",
9898
Example: "drycc builds fetch",
9999
Short: i18n.T("Print process info about a specific build"),
100-
RunE: func(cmd *cobra.Command, args []string) error {
100+
RunE: func(_ *cobra.Command, _ []string) error {
101101
return cmdr.BuildsFetch(app, version, flags.procfile, flags.dryccPath, flags.confirm, flags.save)
102102
},
103103
}

internal/parser/certs.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func NewCertsCommand(cmdr *commands.DryccCmd) *cobra.Command {
1313
cmd := &cobra.Command{
1414
Use: "certs",
1515
Short: i18n.T("Manage SSL endpoints for an app"),
16-
RunE: func(cmd *cobra.Command, args []string) error {
16+
RunE: func(_ *cobra.Command, _ []string) error {
1717
results, _ := commands.ResponseLimit(limit)
1818
return cmdr.CertsList(app, results)
1919
},
@@ -39,7 +39,7 @@ func certsListCommand(cmdr *commands.DryccCmd) *cobra.Command {
3939
Use: "list",
4040
Short: i18n.T("List SSL certificates for an application"),
4141
Long: i18n.T("Show certificate information for an SSL application"),
42-
RunE: func(cmd *cobra.Command, args []string) error {
42+
RunE: func(_ *cobra.Command, _ []string) error {
4343
results, _ := commands.ResponseLimit(limit)
4444
return cmdr.CertsList(app, results)
4545
},
@@ -63,7 +63,7 @@ func certAddCommand(cmdr *commands.DryccCmd) *cobra.Command {
6363
),
6464
Args: cobra.ExactArgs(3),
6565
Short: i18n.T("Add an SSL certificate to an app"),
66-
RunE: func(cmd *cobra.Command, args []string) error {
66+
RunE: func(_ *cobra.Command, args []string) error {
6767
name := args[0]
6868
cert := args[1]
6969
key := args[2]
@@ -88,7 +88,7 @@ func certRemoveCommand(cmdr *commands.DryccCmd) *cobra.Command {
8888
Args: cobra.ExactArgs(1),
8989
Short: i18n.T("Remove an SSL certificate from an app"),
9090
ValidArgsFunction: certCompletion.CompletionFunc,
91-
RunE: func(cmd *cobra.Command, args []string) error {
91+
RunE: func(_ *cobra.Command, args []string) error {
9292
name := args[0]
9393
return cmdr.CertRemove(app, name)
9494
},
@@ -111,7 +111,7 @@ func certInfoCommand(cmdr *commands.DryccCmd) *cobra.Command {
111111
Short: i18n.T("Get detailed informaton about the certificate"),
112112
Long: i18n.T("Fetch more detailed information about a certificate"),
113113
ValidArgsFunction: certCompletion.CompletionFunc,
114-
RunE: func(cmd *cobra.Command, args []string) error {
114+
RunE: func(_ *cobra.Command, args []string) error {
115115
name := args[0]
116116
return cmdr.CertInfo(app, name)
117117
},
@@ -135,7 +135,7 @@ func certAttachCommand(cmdr *commands.DryccCmd) *cobra.Command {
135135
Short: i18n.T("Attach an SSL certificate to a domain"),
136136
Long: i18n.T("Attach a certificate to a domain"),
137137
ValidArgsFunction: certTachCompletion.CompletionFunc,
138-
RunE: func(cmd *cobra.Command, args []string) error {
138+
RunE: func(_ *cobra.Command, args []string) error {
139139
name := args[0]
140140
domain := args[1]
141141
return cmdr.CertAttach(app, name, domain)
@@ -160,7 +160,7 @@ func certDetachCommand(cmdr *commands.DryccCmd) *cobra.Command {
160160
Short: i18n.T("Detach an SSL certificate from a domain"),
161161
Long: i18n.T("Detach certificate from a domain"),
162162
ValidArgsFunction: certTachCompletion.CompletionFunc,
163-
RunE: func(cmd *cobra.Command, args []string) error {
163+
RunE: func(_ *cobra.Command, args []string) error {
164164
name := args[0]
165165
domain := args[1]
166166
return cmdr.CertDetach(app, name, domain)

0 commit comments

Comments
 (0)