Skip to content

Commit

Permalink
chore: make linter happy
Browse files Browse the repository at this point in the history
  • Loading branch information
zbindenren committed Mar 10, 2022
1 parent 10dbb78 commit 5f79b68
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions etcd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"

"github.com/pkg/errors"
Expand Down Expand Up @@ -213,7 +214,7 @@ func WithKeyFile(path string) Opt {
return nil
}

key, err := ioutil.ReadFile(path) //nolint:gosec // G304: Potential file inclusion via variable (gosec)
key, err := os.ReadFile(path) //nolint:gosec // G304: Potential file inclusion via variable (gosec)
if err != nil {
return errors.Wrapf(err, "could not read key file %s", path)
}
Expand Down Expand Up @@ -252,7 +253,7 @@ func WithCertFile(path string) Opt {
return nil
}

cert, err := ioutil.ReadFile(path) //nolint:gosec // G304: Potential file inclusion via variable (gosec)
cert, err := os.ReadFile(path) //nolint:gosec // G304: Potential file inclusion via variable (gosec)
if err != nil {
return errors.Wrapf(err, "could not read cert file %s", path)
}
Expand Down Expand Up @@ -291,7 +292,7 @@ func WithCAFile(path string) Opt {
return nil
}

ca, err := ioutil.ReadFile(path) //nolint:gosec // G304: Potential file inclusion via variable (gosec)
ca, err := os.ReadFile(filepath.Clean(path))
if err != nil {
return errors.Wrapf(err, "could not read ca file %s", path)
}
Expand Down

0 comments on commit 5f79b68

Please sign in to comment.