mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-07 20:15:31 -05:00
remove deprecated use of ioutil (#5205)
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
committed by
GitHub
parent
46cb910637
commit
53d15d329e
@@ -3,7 +3,6 @@ package ldap
|
||||
import (
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -39,7 +38,7 @@ func WaitForCA(log log.Logger, insecure bool, caCert string) error {
|
||||
// Check if this actually is a CA cert. We need to retry here as well
|
||||
// as the file might exist already, but have no contents yet.
|
||||
certs := x509.NewCertPool()
|
||||
pemData, err := ioutil.ReadFile(caCert)
|
||||
pemData, err := os.ReadFile(caCert)
|
||||
if err != nil {
|
||||
log.Debug().Err(err).Str("LDAP CACert", caCert).Msg("Error reading CA")
|
||||
} else if !certs.AppendCertsFromPEM(pemData) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"io"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -28,7 +28,7 @@ type LogrusWrapper struct {
|
||||
// underlying zerolog via hooks.
|
||||
func LogrusWrap(zr zerolog.Logger) *logrus.Logger {
|
||||
lr := logrus.New()
|
||||
lr.SetOutput(ioutil.Discard)
|
||||
lr.SetOutput(io.Discard)
|
||||
lr.SetLevel(logrusLevel(zr.GetLevel()))
|
||||
lr.AddHook(&LogrusWrapper{
|
||||
zeroLog: &zr,
|
||||
@@ -52,7 +52,7 @@ func (h *LogrusWrapper) Fire(entry *logrus.Entry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//Convert logrus fields to zerolog
|
||||
// Convert logrus fields to zerolog
|
||||
func zeroLogFields(fields logrus.Fields) map[string]interface{} {
|
||||
fm := make(map[string]interface{})
|
||||
for k, v := range fields {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"sync"
|
||||
|
||||
mgrpcc "github.com/go-micro/plugins/v4/client/grpc"
|
||||
@@ -68,7 +68,7 @@ func Configure(opts ...ClientOption) error {
|
||||
// Note: If caCert is empty we use the system's default set of trusted CAs
|
||||
if options.caCert != "" {
|
||||
certs := x509.NewCertPool()
|
||||
pemData, err := ioutil.ReadFile(options.caCert)
|
||||
pemData, err := os.ReadFile(options.caCert)
|
||||
if err != nil {
|
||||
outerr = err
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user