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
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@v7
- uses: actions/setup-go@v7
with:
go-version: 'stable'
- name: golangci-golint
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
uses: golangci/golangci-lint-action@v9
with:
version: v2.9.0
version: v2.13.1
1 change: 1 addition & 0 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 Down
4 changes: 2 additions & 2 deletions cfn/event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func TestCloudFormationEventMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/cloudformation-event.json")
inputJSON, err := ioutil.ReadFile("./testdata/cloudformation-event.json") //nolint:govet
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{})
}
2 changes: 1 addition & 1 deletion cfn/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (r *Response) sendWith(client httpClient) error {
return err
}

body, err = ioutil.ReadAll(res.Body)
body, err = ioutil.ReadAll(res.Body) //nolint:govet
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion cfn/wrap_test.go
Original file line number Diff line number Diff line change
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 := ioutil.ReadAll(req.Body) //nolint:govet
assert.NoError(t, err)
var response Response
err = json.Unmarshal(body, &response)
Expand Down
4 changes: 2 additions & 2 deletions cmd/build-lambda-zip/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func compressExeAndArgs(outZipPath string, exePath string, args []string) error

zipWriter := zip.NewWriter(zipFile)
defer zipWriter.Close()
data, err := ioutil.ReadFile(exePath)
data, err := ioutil.ReadFile(exePath) //nolint:govet
if err != nil {
return err
}
Expand All @@ -97,7 +97,7 @@ func compressExeAndArgs(outZipPath string, exePath string, args []string) error
if err != nil {
return err
}
data, err := ioutil.ReadFile(arg)
data, err := ioutil.ReadFile(arg) //nolint:govet
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions cmd/build-lambda-zip/main_test.go
Original file line number Diff line number Diff line change
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 := ioutil.TempDir("/tmp", "build-lambda-zip") //nolint:govet
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 := ioutil.TempDir("/tmp", "build-lambda-zip") //nolint:govet
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 := ioutil.ReadAll(link) //nolint:govet
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 := ioutil.ReadAll(f) //nolint:govet
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{})
}
6 changes: 3 additions & 3 deletions events/alb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestALBTargetRequestMarshaling(t *testing.T) {

for _, filename := range inputFiles {
// read json from file
inputJSON, err := ioutil.ReadFile(filename)
inputJSON, err := ioutil.ReadFile(filename) //nolint:govet
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 := ioutil.ReadFile("./testdata/alb-lambda-target-response.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down
44 changes: 22 additions & 22 deletions events/apigw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
func TestApiGatewayRequestMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-request.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-request.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down Expand Up @@ -57,13 +57,13 @@ func TestApiGatewayRequestMarshaling(t *testing.T) {
}

func TestApiGatewayRequestMalformedJson(t *testing.T) {
test.TestMalformedJson(t, APIGatewayProxyRequest{})
test.TestMalformedJson(t, &APIGatewayProxyRequest{})
}

func TestApiGatewayResponseMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-response.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-response.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -84,7 +84,7 @@ func TestApiGatewayResponseMarshaling(t *testing.T) {
}

func TestApiGatewayResponseMalformedJson(t *testing.T) {
test.TestMalformedJson(t, APIGatewayProxyResponse{})
test.TestMalformedJson(t, &APIGatewayProxyResponse{})
}

func TestAPIGatewayProxyStreamingResponseMarshaling(t *testing.T) {
Expand Down Expand Up @@ -122,7 +122,7 @@ func TestAPIGatewayProxyStreamingResponseMarshaling(t *testing.T) {
},
} {
t.Run(test.name, func(t *testing.T) {
response, err := ioutil.ReadAll(test.response)
response, err := ioutil.ReadAll(test.response) //nolint:govet
require.NoError(t, err)
sep := "\x00\x00\x00\x00\x00\x00\x00\x00"
responseParts := strings.Split(string(response), sep)
Expand Down Expand Up @@ -164,7 +164,7 @@ func TestAPIGatewayProxyStreamingResponsePropogatesInnerClose(t *testing.T) {
func TestApiGatewayCustomAuthorizerRequestMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-custom-auth-request.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-custom-auth-request.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -187,7 +187,7 @@ func TestApiGatewayCustomAuthorizerRequestMarshaling(t *testing.T) {
func TestApiGatewayCustomAuthorizerRequestTypeRequestMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-custom-auth-request-type-request.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-custom-auth-request-type-request.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -208,17 +208,17 @@ func TestApiGatewayCustomAuthorizerRequestTypeRequestMarshaling(t *testing.T) {
}

func TestApiGatewayCustomAuthorizerRequestMalformedJson(t *testing.T) {
test.TestMalformedJson(t, APIGatewayCustomAuthorizerRequest{})
test.TestMalformedJson(t, &APIGatewayCustomAuthorizerRequest{})
}

func TestApiGatewayCustomAuthorizerRequestTypeRequestMalformedJson(t *testing.T) {
test.TestMalformedJson(t, APIGatewayCustomAuthorizerRequestTypeRequest{})
test.TestMalformedJson(t, &APIGatewayCustomAuthorizerRequestTypeRequest{})
}

func TestApiGatewayWebsocketRequestMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-websocket-request.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-websocket-request.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -241,7 +241,7 @@ func TestApiGatewayWebsocketRequestMarshaling(t *testing.T) {
func TestApiGatewayWebsocketRequestSendMessageMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-websocket-request-send-message.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-websocket-request-send-message.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -264,7 +264,7 @@ func TestApiGatewayWebsocketRequestSendMessageMarshaling(t *testing.T) {
func TestApiGatewayWebsocketRequestDisconnectMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-websocket-request-disconnect.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-websocket-request-disconnect.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -285,13 +285,13 @@ func TestApiGatewayWebsocketRequestDisconnectMarshaling(t *testing.T) {
}

func TestApiGatewayWebsocketRequestMalformedJson(t *testing.T) {
test.TestMalformedJson(t, APIGatewayWebsocketProxyRequest{})
test.TestMalformedJson(t, &APIGatewayWebsocketProxyRequest{})
}

func TestApiGatewayCustomAuthorizerResponseMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-custom-auth-response.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-custom-auth-response.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down Expand Up @@ -373,13 +373,13 @@ func TestAPIGatewayV2CustomAuthorizerSimpleResponseMarshalling(t *testing.T) {
}

func TestApiGatewayCustomAuthorizerResponseMalformedJson(t *testing.T) {
test.TestMalformedJson(t, APIGatewayCustomAuthorizerResponse{})
test.TestMalformedJson(t, &APIGatewayCustomAuthorizerResponse{})
}

func TestApiGatewayRestApiOpenApiRequestMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-restapi-openapi-request.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-restapi-openapi-request.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down Expand Up @@ -408,7 +408,7 @@ func TestApiGatewayRestApiOpenApiRequestMarshaling(t *testing.T) {
func TestApiGatewayV2HTTPRequestJWTAuthorizerMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-request-jwt-authorizer.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-request-jwt-authorizer.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down Expand Up @@ -443,7 +443,7 @@ func TestApiGatewayV2HTTPRequestJWTAuthorizerMarshaling(t *testing.T) {
func TestApiGatewayV2HTTPRequestLambdaAuthorizerMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-request-lambda-authorizer.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-request-lambda-authorizer.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down Expand Up @@ -478,7 +478,7 @@ func TestApiGatewayV2HTTPRequestLambdaAuthorizerMarshaling(t *testing.T) {
func TestApiGatewayV2HTTPRequestIAMMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-request-iam.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-request-iam.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down Expand Up @@ -537,7 +537,7 @@ func TestApiGatewayV2HTTPRequestIAMMarshaling(t *testing.T) {
func TestApiGatewayV2HTTPRequestNoAuthorizerMarshaling(t *testing.T) {

// read json from file
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-request-no-authorizer.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-request-no-authorizer.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down Expand Up @@ -570,7 +570,7 @@ func TestApiGatewayV2HTTPRequestNoAuthorizerMarshaling(t *testing.T) {
}

func TestApiGatewayV2CustomAuthorizerV1RequestMarshaling(t *testing.T) {
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-custom-authorizer-v1-request.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-custom-authorizer-v1-request.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -591,7 +591,7 @@ func TestApiGatewayV2CustomAuthorizerV1RequestMarshaling(t *testing.T) {
}

func TestApiGatewayV2CustomAuthorizerV2RequestMarshaling(t *testing.T) {
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-custom-authorizer-v2-request.json")
inputJSON, err := ioutil.ReadFile("./testdata/apigw-v2-custom-authorizer-v2-request.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand Down
12 changes: 6 additions & 6 deletions events/appsync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func TestAppSyncIdentity_IAM(t *testing.T) {
inputJSON, err := ioutil.ReadFile("./testdata/appsync-identity-iam.json")
inputJSON, err := ioutil.ReadFile("./testdata/appsync-identity-iam.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -29,7 +29,7 @@ func TestAppSyncIdentity_IAM(t *testing.T) {
}

func TestAppSyncIdentity_Cognito(t *testing.T) {
inputJSON, err := ioutil.ReadFile("./testdata/appsync-identity-cognito.json")
inputJSON, err := ioutil.ReadFile("./testdata/appsync-identity-cognito.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -48,7 +48,7 @@ func TestAppSyncIdentity_Cognito(t *testing.T) {
}

func TestAppSyncLambdaAuthorizerRequestMarshalling(t *testing.T) {
inputJSON, err := ioutil.ReadFile("./testdata/appsync-lambda-auth-request.json")
inputJSON, err := ioutil.ReadFile("./testdata/appsync-lambda-auth-request.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -67,11 +67,11 @@ func TestAppSyncLambdaAuthorizerRequestMarshalling(t *testing.T) {
}

func TestAppSyncLambdaAuthorizerRequestMalformedJson(t *testing.T) {
test.TestMalformedJson(t, AppSyncLambdaAuthorizerRequest{})
test.TestMalformedJson(t, &AppSyncLambdaAuthorizerRequest{})
}

func TestAppSyncLambdaAuthorizerResponseMarshalling(t *testing.T) {
inputJSON, err := ioutil.ReadFile("./testdata/appsync-lambda-auth-response.json")
inputJSON, err := ioutil.ReadFile("./testdata/appsync-lambda-auth-response.json") //nolint:govet
if err != nil {
t.Errorf("could not open test file. details: %v", err)
}
Expand All @@ -90,5 +90,5 @@ func TestAppSyncLambdaAuthorizerResponseMarshalling(t *testing.T) {
}

func TestAppSyncLambdaAuthorizerResponseMalformedJson(t *testing.T) {
test.TestMalformedJson(t, AppSyncLambdaAuthorizerResponse{})
test.TestMalformedJson(t, &AppSyncLambdaAuthorizerResponse{})
}
2 changes: 1 addition & 1 deletion events/autoscaling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ func TestAutoScalingEventMarshaling(t *testing.T) {
}

func TestAutoScalingMarshalingMalformedJson(t *testing.T) {
test.TestMalformedJson(t, AutoScalingEvent{})
test.TestMalformedJson(t, &AutoScalingEvent{})
}
2 changes: 1 addition & 1 deletion events/chime_bot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ func TestChimeBotEventMarshaling(t *testing.T) {
}

func TestChimeBotMarshalingMalformedJSON(t *testing.T) {
test.TestMalformedJson(t, ChimeBotEvent{})
test.TestMalformedJson(t, &ChimeBotEvent{})
}
Loading
Loading