Skip to content

Commit

Permalink
fix linters #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Neznaemov committed Apr 11, 2024
1 parent 7806e3b commit 566768c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions client/ca/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"

"github.com/golang/protobuf/proto"
Expand Down Expand Up @@ -92,7 +92,7 @@ func (c *Client) setAuthToken(req *http.Request, body []byte) error {

func (c *Client) processResponse(resp *http.Response, out interface{}, expectedHTTPStatuses ...int) error {
defer func() { _ = resp.Body.Close() }()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
if err != nil {
return errors.Wrap(err, `failed to read response body`)
}
Expand Down
4 changes: 2 additions & 2 deletions client/core_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

import (
"fmt"
"io/ioutil"
"os"

"github.com/hyperledger/fabric/msp"
"github.com/pkg/errors"
Expand Down Expand Up @@ -51,7 +51,7 @@ func WithOrderer(orderer api.Orderer) Opt {
// WithConfigYaml allows passing path to YAML configuration file
func WithConfigYaml(configPath string) Opt {
return func(c *Client) error {
configBytes, err := ioutil.ReadFile(configPath)
configBytes, err := os.ReadFile(configPath)
if err != nil {
return errors.Wrap(err, `failed to read config file`)
}
Expand Down
3 changes: 1 addition & 2 deletions client/deliver/testing/deliver.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strconv"
Expand Down Expand Up @@ -75,7 +74,7 @@ func NewDeliverClient(rootPath string, closeWhenAllRead bool) (peer.DeliverClien
return err
}

block, err := ioutil.ReadFile(path)
block, err := os.ReadFile(path)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions client/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net"
"os"
"time"

grpcretry "github.com/grpc-ecosystem/go-grpc-middleware/retry"
Expand Down Expand Up @@ -80,7 +80,7 @@ func OptionsFromConfig(c config.ConnectionConfig, logger *zap.Logger) (*Opts, er
if len(c.Tls.CACert) != 0 {
caCert = c.Tls.CACert
} else {
caCert, err = ioutil.ReadFile(c.Tls.CACertPath)
caCert, err = os.ReadFile(c.Tls.CACertPath)
if err != nil {
return nil, fmt.Errorf(`read CA certificate: %w`, err)
}
Expand Down
3 changes: 3 additions & 0 deletions client/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ func (p *peer) ParsedBlocks(ctx context.Context, channel string, identity msp.Si

for {
select {
case <-ctx.Done():
return

case b, ok := <-commonBlocks:
if !ok {
return
Expand Down

0 comments on commit 566768c

Please sign in to comment.