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

remove deprecated io/ioutil package reference from goscaleio #80

Merged
merged 2 commits into from
Aug 16, 2023
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
4 changes: 2 additions & 2 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"encoding/base64"
"errors"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"os"
Expand Down Expand Up @@ -219,7 +219,7 @@ func (c *Client) getJSONWithRetry(
}

func extractString(resp *http.Response) (string, error) {
bs, err := ioutil.ReadAll(resp.Body)
bs, err := io.ReadAll(resp.Body)
if err != nil {
return "", errBodyRead
}
Expand Down
3 changes: 1 addition & 2 deletions api/api_logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httputil"
"strings"
Expand Down Expand Up @@ -146,7 +145,7 @@ func drainBody(b io.ReadCloser) (r1, r2 io.ReadCloser, err error) {
if err = b.Close(); err != nil {
return nil, b, err
}
return ioutil.NopCloser(&buf), ioutil.NopCloser(bytes.NewReader(buf.Bytes())), nil
return io.NopCloser(&buf), io.NopCloser(bytes.NewReader(buf.Bytes())), nil
}

func dumpRequest(req *http.Request, body bool) ([]byte, error) {
Expand Down
3 changes: 1 addition & 2 deletions api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"math"
"net/http"
"net/http/httptest"
Expand Down Expand Up @@ -305,7 +304,7 @@ func testBuildError(code int) error {

func testReadAll(t *testing.T, rc io.ReadCloser) []byte {
t.Helper()
b, err := ioutil.ReadAll(rc)
b, err := io.ReadAll(rc)
if err != nil {
t.Fatal(err)
}
Expand Down
4 changes: 2 additions & 2 deletions volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ package goscaleio
import (
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"regexp"
"sort"
Expand Down Expand Up @@ -161,7 +161,7 @@ func getVolumeMapping(sysID string, volID string) (mappedVolumes []*SdcMappedVol
mappedVolumesMap := make(map[string]*SdcMappedVolume)

diskIDPath := FSDevDirectoryPrefix + "/dev/disk/by-id"
files, _ := ioutil.ReadDir(diskIDPath)
files, _ := os.ReadDir(diskIDPath)
strRegex := fmt.Sprintf(`^emc-vol-%s-%s$`, sysID, volID)
r, _ := regexp.Compile(strRegex)
for _, f := range files {
Expand Down