Skip to content
Open
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 @@ -6,7 +6,6 @@ package testdata
import (
"bytes"
"fmt"
"io/ioutil"
"net"
"os"
"os/exec"
Expand All @@ -30,7 +29,7 @@ func CreateTestSocketPair(t *testing.T) (fd [2]int) {
}

func CreateTestLogFile(t *testing.T) *os.File {
file, err := ioutil.TempFile(os.TempDir(), "rapid-unit-tests")
file, err := os.CreateTemp(os.TempDir(), "rapid-unit-tests")
assert.NoError(t, err, "error opening tmp log file for test")
return file
}
Expand Down
4 changes: 2 additions & 2 deletions internal/lambda-managed-instances/testdata/flowtesting.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package testdata
import (
"bytes"
"context"
"io/ioutil"
"io"

"github.com/aws/aws-lambda-runtime-interface-emulator/internal/lambda-managed-instances/appctx"
"github.com/aws/aws-lambda-runtime-interface-emulator/internal/lambda-managed-instances/core"
Expand All @@ -29,7 +29,7 @@ type MockInteropServer struct {
}

func (i *MockInteropServer) SendResponse(invokeID string, resp *interop.StreamableInvokeResponse) (*interop.InvokeResponseMetrics, error) {
bytes, err := ioutil.ReadAll(resp.Payload)
bytes, err := io.ReadAll(resp.Payload)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions internal/lambda/rie/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"os"
Expand Down Expand Up @@ -76,7 +76,7 @@ func printEndReports(invokeId string, initDuration string, memorySize string, in

func InvokeHandler(w http.ResponseWriter, r *http.Request, sandbox Sandbox, bs interop.Bootstrap) {
log.Debugf("invoke: -> %s %s %v", r.Method, r.URL, r.Header)
bodyBytes, err := ioutil.ReadAll(r.Body)
bodyBytes, err := io.ReadAll(r.Body)
if err != nil {
log.Errorf("Failed to read invoke body: %s", err)
w.WriteHeader(500)
Expand Down
4 changes: 2 additions & 2 deletions internal/lambda/testdata/flowtesting.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package testdata
import (
"bytes"
"context"
"io/ioutil"
"io"
"time"

"github.com/aws/aws-lambda-runtime-interface-emulator/internal/lambda/appctx"
Expand All @@ -32,7 +32,7 @@ type MockInteropServer struct {

// SendResponse writes response to a shared memory.
func (i *MockInteropServer) SendResponse(invokeID string, resp *interop.StreamableInvokeResponse) error {
bytes, err := ioutil.ReadAll(resp.Payload)
bytes, err := io.ReadAll(resp.Payload)
if err != nil {
return err
}
Expand Down