Skip to content
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
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
name: run golangci-golint on the project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
with:
go-version: 'stable'
- name: golangci-golint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9
with:
version: v2.9.0
version: v2.13.1
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
fail-fast: false
matrix:
go:
- "1.27"
- "1.26"
- "1.25"
- "1.24"
Expand All @@ -22,9 +23,6 @@ jobs:
- "1.18"
- "1.17"
- "1.16"
- "1.15"
- "1.14"
- "1.13"

steps:
- name: Set up Go ${{ matrix.go }}
Expand Down
6 changes: 3 additions & 3 deletions cfn/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package cfn

import (
"encoding/json"
"io/ioutil" //nolint: staticcheck
"os"
"testing"

"github.com/aws/aws-lambda-go/events/test"
Expand All @@ -13,7 +13,7 @@ import (
func TestCloudFormationEventMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/cloudformation-event.json")
inputJSON, err := os.ReadFile("./testdata/cloudformation-event.json")
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -34,5 +34,5 @@ func TestCloudFormationEventMarshaling(t *testing.T) {
}

func TestCloudFormationMarshalingMalformedJson(t *testing.T) {
test.TestMalformedJson(t, Event{})
test.TestMalformedJson(t, &Event{})
}
4 changes: 2 additions & 2 deletions cfn/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil" //nolint: staticcheck
"io"
"log"
"net/http"
)
Expand Down Expand Up @@ -67,7 +67,7 @@ func (r *Response) sendWith(client httpClient) error {
return err
}

body, err = ioutil.ReadAll(res.Body)
body, err = io.ReadAll(res.Body)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions cfn/wrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil" //nolint: staticcheck
"io"
"net/http"
"testing"

Expand Down Expand Up @@ -209,7 +209,7 @@ func TestWrappedSendFailure(t *testing.T) {
func extractResponseBody(t *testing.T, req *http.Request) Response {
assert.NotContains(t, req.Header, "Content-Type")

body, err := ioutil.ReadAll(req.Body)
body, err := io.ReadAll(req.Body)
assert.NoError(t, err)
var response Response
err = json.Unmarshal(body, &response)
Expand Down
5 changes: 2 additions & 3 deletions cmd/build-lambda-zip/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"archive/zip"
"flag"
"fmt"
"io/ioutil" //nolint: staticcheck
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -82,7 +81,7 @@ func compressExeAndArgs(outZipPath string, exePath string, args []string) error

zipWriter := zip.NewWriter(zipFile)
defer zipWriter.Close()
data, err := ioutil.ReadFile(exePath)
data, err := os.ReadFile(exePath)
if err != nil {
return err
}
Expand All @@ -97,7 +96,7 @@ func compressExeAndArgs(outZipPath string, exePath string, args []string) error
if err != nil {
return err
}
data, err := ioutil.ReadFile(arg)
data, err := os.ReadFile(arg)
if err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions cmd/build-lambda-zip/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package main
import (
"archive/zip"
"fmt"
"io/ioutil" //nolint: staticcheck
"io"
"os"
"os/exec"
"path"
Expand Down Expand Up @@ -34,7 +34,7 @@ func TestSizes(t *testing.T) {
}
testDir, err := os.Getwd()
require.NoError(t, err)
tempDir, err := ioutil.TempDir("/tmp", "build-lambda-zip")
tempDir, err := os.MkdirTemp("/tmp", "build-lambda-zip")
require.NoError(t, err)
for _, test := range cases {
require.NoError(t, os.Chdir(testDir))
Expand Down Expand Up @@ -66,7 +66,7 @@ func TestSizes(t *testing.T) {
}

func TestCompressExeAndArgs(t *testing.T) {
tempDir, err := ioutil.TempDir("/tmp", "build-lambda-zip")
tempDir, err := os.MkdirTemp("/tmp", "build-lambda-zip")
require.NoError(t, err)
defer os.RemoveAll(tempDir)

Expand Down Expand Up @@ -117,7 +117,7 @@ func TestCompressExeAndArgs(t *testing.T) {
link, err := bootstrap.Open()
require.NoError(t, err)
defer link.Close()
linkTarget, err := ioutil.ReadAll(link)
linkTarget, err := io.ReadAll(link)
require.NoError(t, err)
assert.Equal(t, filepath.Base(filePaths[0]), string(linkTarget))
})
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestCompressExeAndArgs(t *testing.T) {
f, err := zf.Open()
require.NoError(t, err)
defer f.Close()
content, err := ioutil.ReadAll(f)
content, err := io.ReadAll(f)
require.NoError(t, err)
assert.Equal(t, fmt.Sprintf("Hello file %d!", expectedIndex), string(content), "in file: %s", zf.Name)
expectedIndex++
Expand Down
2 changes: 1 addition & 1 deletion events/activemq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ func TestActiveMQEventMarshaling(t *testing.T) {
}

func TestActiveMQMarshalingMalformedJson(t *testing.T) {
test.TestMalformedJson(t, ActiveMQEvent{})
test.TestMalformedJson(t, &ActiveMQEvent{})
}
8 changes: 4 additions & 4 deletions events/alb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package events

import (
"encoding/json"
"io/ioutil" //nolint: staticcheck
"os"
"testing"

"github.com/aws/aws-lambda-go/events/test"
Expand All @@ -16,7 +16,7 @@ func TestALBTargetRequestMarshaling(t *testing.T) {

for _, filename := range inputFiles {
// read json from file
inputJSON, err := ioutil.ReadFile(filename)
inputJSON, err := os.ReadFile(filename)
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -37,13 +37,13 @@ func TestALBTargetRequestMarshaling(t *testing.T) {
}

func TestALBTargetRequestMalformedJson(t *testing.T) {
test.TestMalformedJson(t, ALBTargetGroupRequest{})
test.TestMalformedJson(t, &ALBTargetGroupRequest{})
}

func TestALBTargetResponseMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/alb-lambda-target-response.json")
inputJSON, err := os.ReadFile("./testdata/alb-lambda-target-response.json")
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down
Loading
Loading