You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by fr...@apache.org on 2022/10/09 22:37:14 UTC

[calcite-avatica-go] 02/08: [CALCITE-5318] Replace deprecated ioutil methods with io and os equivalents

This is an automated email from the ASF dual-hosted git repository.

francischuang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git

commit 0b5fc0e98cea8ac5b948232477ebdb79e245f998
Author: Francis Chuang <fr...@apache.org>
AuthorDate: Mon Oct 10 09:06:15 2022 +1100

    [CALCITE-5318] Replace deprecated ioutil methods with io and os equivalents
---
 driver_hsqldb_test.go  | 3 +--
 driver_phoenix_test.go | 3 +--
 http_client.go         | 4 ++--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/driver_hsqldb_test.go b/driver_hsqldb_test.go
index d5f47f1..70dcff7 100644
--- a/driver_hsqldb_test.go
+++ b/driver_hsqldb_test.go
@@ -21,7 +21,6 @@ import (
 	"bytes"
 	"crypto/sha256"
 	"database/sql"
-	"io/ioutil"
 	"os"
 	"path/filepath"
 	"sync"
@@ -692,7 +691,7 @@ func TestHSQLDBStoreAndRetrieveBinaryData(t *testing.T) {
 
 		filePath := filepath.Join("test-fixtures", "calcite.png")
 
-		file, err := ioutil.ReadFile(filePath)
+		file, err := os.ReadFile(filePath)
 
 		if err != nil {
 			t.Fatalf("Unable to read text-fixture: %s", filePath)
diff --git a/driver_phoenix_test.go b/driver_phoenix_test.go
index d117785..ae12cef 100644
--- a/driver_phoenix_test.go
+++ b/driver_phoenix_test.go
@@ -22,7 +22,6 @@ import (
 	"crypto/sha256"
 	"database/sql"
 	"fmt"
-	"io/ioutil"
 	"os"
 	"path/filepath"
 	"sync"
@@ -780,7 +779,7 @@ func TestPhoenixStoreAndRetrieveBinaryData(t *testing.T) {
 
 		filePath := filepath.Join("test-fixtures", "calcite.png")
 
-		file, err := ioutil.ReadFile(filePath)
+		file, err := os.ReadFile(filePath)
 
 		if err != nil {
 			t.Fatalf("Unable to read text-fixture: %s", filePath)
diff --git a/http_client.go b/http_client.go
index 2d8106b..e94e66b 100644
--- a/http_client.go
+++ b/http_client.go
@@ -22,7 +22,7 @@ import (
 	"context"
 	"database/sql/driver"
 	"fmt"
-	"io/ioutil"
+	"io"
 	"net"
 	"net/http"
 	"regexp"
@@ -132,7 +132,7 @@ func (c *httpClient) post(ctx context.Context, message proto.Message) (proto.Mes
 
 	defer res.Body.Close()
 
-	response, err := ioutil.ReadAll(res.Body)
+	response, err := io.ReadAll(res.Body)
 
 	if err != nil {
 		return nil, fmt.Errorf("error reading response body: %w", err)