fix lint
This commit is contained in:
parent
b360c9403f
commit
325a4c0e5b
30
cli/net.go
30
cli/net.go
@ -643,9 +643,7 @@ var NetStatCmd = &cli.Command{
|
||||
}
|
||||
|
||||
enc := json.NewEncoder(os.Stdout)
|
||||
enc.Encode(result)
|
||||
|
||||
return nil
|
||||
return enc.Encode(result)
|
||||
},
|
||||
}
|
||||
|
||||
@ -694,21 +692,19 @@ var NetLimitCmd = &cli.Command{
|
||||
|
||||
return api.NetSetLimit(ctx, scope, limit)
|
||||
|
||||
} else {
|
||||
if len(args) != 1 {
|
||||
return xerrors.Errorf("must specify exactly one scope")
|
||||
}
|
||||
scope := args[0]
|
||||
|
||||
result, err := api.NetLimit(ctx, scope)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
enc := json.NewEncoder(os.Stdout)
|
||||
enc.Encode(result)
|
||||
}
|
||||
|
||||
return nil
|
||||
if len(args) != 1 {
|
||||
return xerrors.Errorf("must specify exactly one scope")
|
||||
}
|
||||
scope := args[0]
|
||||
|
||||
result, err := api.NetLimit(ctx, scope)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
enc := json.NewEncoder(os.Stdout)
|
||||
return enc.Encode(result)
|
||||
},
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ func ResourceManager(lc fx.Lifecycle, repo repo.LockedRepo) (network.ResourceMan
|
||||
limitsIn, err := os.Open(limitsFile)
|
||||
switch {
|
||||
case err == nil:
|
||||
defer limitsIn.Close()
|
||||
defer limitsIn.Close() //nolint:errcheck
|
||||
limiter, err = rcmgr.NewDefaultLimiterFromJSON(limitsIn)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error parsing limit file: %w", err)
|
||||
|
Loading…
Reference in New Issue
Block a user