1
0
mirror of https://github.com/minio/mc.git synced 2025-07-28 20:01:58 +03:00

cleanup commands to use Go 'err' as 'e' (#4232)

many commands seem to have sort of had
stopped following the expected convention
in `mc` to differentiate *probe.Error.

To keep things readable this PR is the
first attempt at such a cleanup.
This commit is contained in:
Harshavardhana
2022-09-06 08:03:25 -07:00
committed by GitHub
parent 2c9a733cae
commit 5cd7ff8876
22 changed files with 104 additions and 114 deletions

View File

@ -85,7 +85,7 @@ func mainAdminSpeedTestObject(ctx *cli.Context, aliasedURL string) error {
// in all other scenarios keep auto-tuning on.
autotune := !ctx.IsSet("concurrent")
resultCh, speedTestErr := client.Speedtest(ctxt, madmin.SpeedtestOpts{
resultCh, e := client.Speedtest(ctxt, madmin.SpeedtestOpts{
Size: int(size),
Duration: duration,
Concurrency: concurrent,
@ -94,10 +94,10 @@ func mainAdminSpeedTestObject(ctx *cli.Context, aliasedURL string) error {
})
if globalJSON {
if speedTestErr != nil {
if e != nil {
printMsg(speedTestResult{
Type: objectSpeedTest,
Err: speedTestErr.Error(),
Err: e.Error(),
Final: true,
})
return nil
@ -134,10 +134,10 @@ func mainAdminSpeedTestObject(ctx *cli.Context, aliasedURL string) error {
}()
go func() {
if speedTestErr != nil {
if e != nil {
p.Send(speedTestResult{
Type: objectSpeedTest,
Err: speedTestErr.Error(),
Err: e.Error(),
Final: true,
})
return