From 1f9d22a29286895cd9700f606cecc03aa7f70a73 Mon Sep 17 00:00:00 2001 From: Nathan Toups Date: Sun, 2 Feb 2025 18:19:10 -0700 Subject: [PATCH 1/3] chore(dep): update testify to v1.10.0, add 1.23 to testing --- .github/workflows/tests.yml | 2 +- go.mod | 2 +- go.sum | 6 ++---- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ebe9956a..5ad69af4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,6 +11,7 @@ jobs: fail-fast: false matrix: go: + - "1.23" - "1.22" - "1.21" - "1.20" @@ -78,4 +79,3 @@ jobs: env_vars: GO env: GO: ${{ matrix.go }} - diff --git a/go.mod b/go.mod index 81f4d599..0123704e 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/aws/aws-lambda-go go 1.18 -require github.com/stretchr/testify v1.7.2 +require github.com/stretchr/testify v1.10.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/go.sum b/go.sum index 47d6d021..713a0b4f 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,9 @@ -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= -github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From 743a2bc89744f0c7ce28d7fea4bedf4e84c505c8 Mon Sep 17 00:00:00 2001 From: Nathan Toups Date: Sun, 2 Feb 2025 22:03:46 -0700 Subject: [PATCH 2/3] chore(ci): removed unsupported versions of go for testify --- .github/workflows/tests.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5ad69af4..93fbe6e5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,11 +18,6 @@ jobs: - "1.19" - "1.18" - "1.17" - - "1.16" - - "1.15" - - "1.14" - - "1.13" - steps: - name: Set up Go ${{ matrix.go }} uses: actions/setup-go@v3 From 9a9bf2c0b02d81ec45ca49150e7e35c483989272 Mon Sep 17 00:00:00 2001 From: Nathan Toups Date: Sun, 2 Feb 2025 22:11:25 -0700 Subject: [PATCH 3/3] fix(linter): updated linter and addressed ctx linting issue --- .github/workflows/lint.yml | 7 +++---- .gitignore | 3 +++ lambda/rpc_function_test.go | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3c948d56..3673309f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,14 +10,13 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: '^1' - + go-version: "^1" + - run: go version - uses: actions/checkout@v3 - name: golangci-golint run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.63.4 ./bin/golangci-lint run -v ./... - diff --git a/.gitignore b/.gitignore index 86114d92..f2c5620f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ # Go Dep vendor + +# ignore golangci-lint binary if running locally +bin/golangci-lint diff --git a/lambda/rpc_function_test.go b/lambda/rpc_function_test.go index 515fc62a..86d38f8f 100644 --- a/lambda/rpc_function_test.go +++ b/lambda/rpc_function_test.go @@ -64,7 +64,9 @@ func TestInvoke(t *testing.T) { } func TestInvokeWithContext(t *testing.T) { - key := struct{}{} + // dummyKey creates a safe context to appease the linter + type dummyKey struct{} + var key dummyKey srv := NewFunction(&handlerOptions{ handlerFunc: func(ctx context.Context, _ []byte) (io.Reader, error) { assert.Equal(t, "dummy", ctx.Value(key))