Replaced deprecated io/ioutil functions (#768)

Signed-off-by: slab713 <109306207+slab713@users.noreply.github.com>
This commit is contained in:
slab713
2022-09-02 14:56:02 +02:00
committed by GitHub
parent 6ae793eb51
commit 8ffb053cec
36 changed files with 249 additions and 280 deletions
+4 -4
View File
@@ -5,9 +5,9 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"runtime"
"strings"
goSync "sync"
@@ -92,11 +92,11 @@ func DumpRuntimeParams(log log.Logger) {
evt = evt.Uint64("max. open files", rLimit.Cur)
}
if content, err := ioutil.ReadFile("/proc/sys/net/core/somaxconn"); err == nil {
if content, err := os.ReadFile("/proc/sys/net/core/somaxconn"); err == nil {
evt = evt.Str("listen backlog", strings.TrimSuffix(string(content), "\n"))
}
if content, err := ioutil.ReadFile("/proc/sys/user/max_inotify_watches"); err == nil {
if content, err := os.ReadFile("/proc/sys/user/max_inotify_watches"); err == nil {
evt = evt.Str("max. inotify watches", strings.TrimSuffix(string(content), "\n"))
}
@@ -196,7 +196,7 @@ func (c *Controller) Run(reloadCtx context.Context) error {
clientAuth = tls.RequireAndVerifyClientCert
}
caCert, err := ioutil.ReadFile(c.Config.HTTP.TLS.CACert)
caCert, err := os.ReadFile(c.Config.HTTP.TLS.CACert)
if err != nil {
panic(err)
}