Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzo committed Jan 20, 2022
1 parent b360c94 commit 325a4c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
26 changes: 11 additions & 15 deletions cli/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,7 @@ var NetStatCmd = &cli.Command{
}

enc := json.NewEncoder(os.Stdout)
enc.Encode(result)

return nil
return enc.Encode(result)
},
}

Expand Down Expand Up @@ -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
}
if len(args) != 1 {
return xerrors.Errorf("must specify exactly one scope")
}
scope := args[0]

enc := json.NewEncoder(os.Stdout)
enc.Encode(result)
result, err := api.NetLimit(ctx, scope)
if err != nil {
return err
}

return nil
enc := json.NewEncoder(os.Stdout)
return enc.Encode(result)
},
}
2 changes: 1 addition & 1 deletion node/modules/lp2p/rcmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 325a4c0

Please sign in to comment.