Skip to content

Commit

Permalink
stop using io/ioutil to make linter happy
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <[email protected]>
  • Loading branch information
timvaillancourt committed Dec 9, 2023
1 parent ca4feaf commit 86c8670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions go/base/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
package base

import (
"io/ioutil"
"os"
"testing"
"time"
Expand Down Expand Up @@ -68,7 +67,7 @@ func TestReadConfigFile(t *testing.T) {
}
}
{
f, err := ioutil.TempFile("", t.Name())
f, err := os.CreateTemp("", t.Name())
if err != nil {
t.Fatalf("Failed to create tmp file: %v", err)
}
Expand All @@ -82,7 +81,7 @@ func TestReadConfigFile(t *testing.T) {
}
}
{
f, err := ioutil.TempFile("", t.Name())
f, err := os.CreateTemp("", t.Name())
if err != nil {
t.Fatalf("Failed to create tmp file: %v", err)
}
Expand All @@ -102,7 +101,7 @@ func TestReadConfigFile(t *testing.T) {
}
}
{
f, err := ioutil.TempFile("", t.Name())
f, err := os.CreateFile("", t.Name())

Check failure on line 104 in go/base/context_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: os.CreateFile (typecheck)

Check failure on line 104 in go/base/context_test.go

View workflow job for this annotation

GitHub Actions / build

undefined: os.CreateFile
if err != nil {
t.Fatalf("Failed to create tmp file: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions go/mysql/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"net"
"os"
"strings"

"github.com/go-sql-driver/mysql"
Expand Down Expand Up @@ -78,7 +78,7 @@ func (this *ConnectionConfig) UseTLS(caCertificatePath, clientCertificate, clien
}
} else {
rootCertPool = x509.NewCertPool()
pem, err := ioutil.ReadFile(caCertificatePath)
pem, err := os.ReadFile(caCertificatePath)
if err != nil {
return err
}
Expand Down

0 comments on commit 86c8670

Please sign in to comment.