Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated ioutil pkg with os & io #17392

Merged
merged 1 commit into from
Jun 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package apimanagement_test
import (
"context"
"fmt"
"io/ioutil"
"os"
"strings"
"testing"

Expand All @@ -20,7 +20,7 @@ type ApiManagementApiSchemaResource struct{}
func TestAccApiManagementApiSchema_basic(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_api_management_api_schema", "test")
r := ApiManagementApiSchemaResource{}
schema, _ := ioutil.ReadFile("testdata/api_management_api_schema.xml")
schema, _ := os.ReadFile("testdata/api_management_api_schema.xml")

data.ResourceTest(t, r, []acceptance.TestStep{
{
Expand All @@ -37,7 +37,7 @@ func TestAccApiManagementApiSchema_basic(t *testing.T) {
func TestAccApiManagementApiSchema_basicSwagger(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_api_management_api_schema", "test")
r := ApiManagementApiSchemaResource{}
schema, _ := ioutil.ReadFile("testdata/api_management_api_schema_swagger.json")
schema, _ := os.ReadFile("testdata/api_management_api_schema_swagger.json")

data.ResourceTest(t, r, []acceptance.TestStep{
{
Expand Down
4 changes: 2 additions & 2 deletions internal/services/appservice/helpers/publish_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"os"
"time"
Expand Down Expand Up @@ -182,7 +182,7 @@ func checkZipDeploymentStatusRefresh(r *http.Request) pluginsdk.StateRefreshFunc
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusAccepted {
return nil, "", fmt.Errorf("failed to read Zip Deployment status: %s", resp.Status)
}
respBody, err := ioutil.ReadAll(resp.Body)
respBody, err := io.ReadAll(resp.Body)
if err != nil {
return nil, "", fmt.Errorf("reading status response body for Zip Deploy")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/services/storage/storage_account_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package storage_test
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"testing"
Expand Down Expand Up @@ -960,7 +960,7 @@ func TestAccAzureRMStorageAccount_sharePropertiesUpdate(t *testing.T) {
func TestAccAzureRMStorageAccount_shareSoftDelete(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_storage_account", "test")
r := StorageAccountResource{}
sourceBlob, err := ioutil.TempFile("", "")
sourceBlob, err := os.CreateTemp("", "")
if err != nil {
t.Fatalf("Failed to create local source blob file")
}
Expand Down