Skip to content

Commit

Permalink
Drop ioutil package.
Browse files Browse the repository at this point in the history
Signed-off-by: zhanluxianshen <[email protected]>
  • Loading branch information
zhanluxianshen authored and MandssS committed Jul 1, 2024
1 parent 7b9994d commit 7464929
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions exec/executor_ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,15 @@ package exec
import (
"context"
"fmt"
"github.com/chaosblade-io/chaosblade-spec-go/log"
"io/ioutil"
"net"
"os"
"path"
"strconv"
"strings"
"time"

"github.com/chaosblade-io/chaosblade-spec-go/log"

"github.com/chaosblade-io/chaosblade-exec-os/version"

"github.com/chaosblade-io/chaosblade-spec-go/spec"
Expand Down Expand Up @@ -284,7 +285,7 @@ func (c *SSHClient) connect() error {
if c.Key == "" {
auth = append(auth, ssh.Password(c.Password))
} else {
pemBytes, err := ioutil.ReadFile(c.Key)
pemBytes, err := os.ReadFile(c.Key)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions exec/nginx/nginx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
"testing"
Expand Down Expand Up @@ -89,7 +89,7 @@ func (tc *testCase) expectResponse(ctx context.Context, path, respBody string, r
tc.t.Fatal(err.Error())
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
body, err := io.ReadAll(resp.Body)
bodyString := strings.TrimSpace(string(body[:]))
if err != nil {
tc.t.Fatal(err.Error())
Expand Down

0 comments on commit 7464929

Please sign in to comment.