Skip to content

Commit

Permalink
Merge pull request #665 from vruge/patch-1
Browse files Browse the repository at this point in the history
fix: deprecation warnings for ioutil
  • Loading branch information
MattBrittan committed Mar 26, 2024
2 parents 1a63b63 + 8f6a9be commit b7215e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/ssl/main.go
Expand Up @@ -48,7 +48,7 @@ import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"os"
"time"

MQTT "github.com/eclipse/paho.mqtt.golang"
Expand All @@ -59,7 +59,7 @@ func NewTLSConfig() *tls.Config {
// Alternatively, manually add CA certificates to
// default openssl CA bundle.
certpool := x509.NewCertPool()
pemCerts, err := ioutil.ReadFile("samplecerts/CAfile.pem")
pemCerts, err := os.ReadFile("samplecerts/CAfile.pem")
if err == nil {
certpool.AppendCertsFromPEM(pemCerts)
}
Expand Down
3 changes: 1 addition & 2 deletions filestore.go
Expand Up @@ -19,7 +19,6 @@
package mqtt

import (
"io/ioutil"
"os"
"path"
"sort"
Expand Down Expand Up @@ -166,7 +165,7 @@ func (store *FileStore) all() []string {
return nil
}

files, err = ioutil.ReadDir(store.directory)
files, err = os.ReadDir(store.directory)
chkerr(err)
sort.Sort(files)
for _, f := range files {
Expand Down

0 comments on commit b7215e4

Please sign in to comment.