1
0
mirror of https://github.com/minio/mc.git synced 2025-07-30 07:23:03 +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

@ -54,19 +54,19 @@ func mainAdminSpeedTestNetperf(ctx *cli.Context, aliasedURL string) error {
defer close(resultCh)
defer close(errorCh)
result, err := client.Netperf(ctxt, duration)
if err != nil {
errorCh <- err
result, e := client.Netperf(ctxt, duration)
if e != nil {
errorCh <- e
}
resultCh <- result
}()
if globalJSON {
select {
case err := <-errorCh:
case e := <-errorCh:
printMsg(speedTestResult{
Type: netSpeedTest,
Err: err.Error(),
Err: e.Error(),
Final: true,
})
case result := <-resultCh:
@ -92,10 +92,10 @@ func mainAdminSpeedTestNetperf(ctx *cli.Context, aliasedURL string) error {
go func() {
for {
select {
case err := <-errorCh:
case e := <-errorCh:
p.Send(speedTestResult{
Type: netSpeedTest,
Err: err.Error(),
Err: e.Error(),
Final: true,
})
return