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
2 changes: 1 addition & 1 deletion .github/workflows/build-lambda-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Setup Go
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v6

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +53,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v4

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +67,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4
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@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: golangci-golint
uses: golangci/golangci-lint-action@v6
uses: golangci/golangci-lint-action@v9
with:
version: v1.64.5
version: v2.7.1
12 changes: 6 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}

Expand All @@ -38,7 +38,7 @@ jobs:
- run: chmod +x /usr/local/bin/aws-lambda-rie

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Edit the go.mod file to allow tests to run for versions of go before 1.16
run: >
Expand All @@ -60,7 +60,7 @@ jobs:
- "1.25"
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}

Expand All @@ -69,15 +69,15 @@ jobs:
- run: chmod +x /usr/local/bin/aws-lambda-rie

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: go test
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v5
with:
file: ./coverage.txt
files: ./coverage.txt
env_vars: GO
env:
GO: ${{ matrix.go }}
Expand Down
146 changes: 78 additions & 68 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,85 @@
version: "2"
linters:
disable-all: true
default: none
enable:
- gofmt
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- stylecheck

issues:
exclude-dirs:
# These were code-generated, and cannot be changed without breaking RPC compatibility.
- lambda/messages

linters-settings:
staticcheck:
checks:
- all
- '-SA1029'
stylecheck:
checks:
- "all"
initialisms:
- "ACL"
- "AMQP"
- "API"
- "ARN"
- "ASCII"
- "AWS"
- "CPU"
- "CSS"
- "DB"
- "DNS"
- "EOF"
- "GID"
- "GUID"
- "HTML"
- "HTTP"
- "HTTPS"
- "IAM"
- "ID"
- "IP"
- "JSON"
- "MQTT"
- "OTF"
- "QPS"
- "RAM"
- "RPC"
- "RTP"
- "SIP"
- "SLA"
- "SMTP"
- "SQL"
- "SSH"
- "TCP"
- "TLS"
- "TS"
- "TTL"
- "UDP"
- "UI"
- "UID"
- "URI"
- "URL"
- "UTF8"
- "UUID"
- "VM"
- "VPC"
- "XML"
- "XMPP"
- "XSRF"
- "XSS"
settings:
staticcheck:
checks:
- all
- -SA1029
initialisms:
- ACL
- AMQP
- API
- ARN
- ASCII
- AWS
- CPU
- CSS
- DB
- DNS
- EOF
- GID
- GUID
- HTML
- HTTP
- HTTPS
- IAM
- ID
- IP
- JSON
- MQTT
- OTF
- QPS
- RAM
- RPC
- RTP
- SIP
- SLA
- SMTP
- SQL
- SSH
- TCP
- TLS
- TS
- TTL
- UDP
- UI
- UID
- URI
- URL
- UTF8
- UUID
- VM
- VPC
- XML
- XMPP
- XSRF
- XSS
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- lambda/messages
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
exclusions:
generated: lax
paths:
- lambda/messages
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion events/alb.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ALBTargetGroupRequestContext struct {

// ELBContext contains the information to identify the ARN invoking the lambda
type ELBContext struct {
TargetGroupArn string `json:"targetGroupArn"` //nolint: stylecheck
TargetGroupArn string `json:"targetGroupArn"` //nolint: staticcheck
}

// ALBTargetGroupResponse configures the response to be returned by the ALB Lambda target group for the request
Expand Down
10 changes: 5 additions & 5 deletions events/apigw.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ type APIGatewayRequestIdentity struct {
SourceIP string `json:"sourceIp"`
CognitoAuthenticationType string `json:"cognitoAuthenticationType,omitempty"`
CognitoAuthenticationProvider string `json:"cognitoAuthenticationProvider,omitempty"`
UserArn string `json:"userArn,omitempty"` //nolint: stylecheck
UserArn string `json:"userArn,omitempty"` //nolint: staticcheck
UserAgent string `json:"userAgent"`
User string `json:"user,omitempty"`
ClientCert *APIGatewayCustomAuthorizerRequestTypeRequestIdentityClientCert `json:"clientCert,omitempty"`
Expand Down Expand Up @@ -317,7 +317,7 @@ type APIGatewayV2CustomAuthorizerV1RequestTypeRequestContext struct {
type APIGatewayV2CustomAuthorizerV1Request struct {
Version string `json:"version"`
Type string `json:"type"`
MethodArn string `json:"methodArn"` //nolint: stylecheck
MethodArn string `json:"methodArn"` //nolint: staticcheck
IdentitySource string `json:"identitySource"`
AuthorizationToken string `json:"authorizationToken"`
Resource string `json:"resource"`
Expand All @@ -333,7 +333,7 @@ type APIGatewayV2CustomAuthorizerV1Request struct {
type APIGatewayV2CustomAuthorizerV2Request struct {
Version string `json:"version"`
Type string `json:"type"`
RouteArn string `json:"routeArn"` //nolint: stylecheck
RouteArn string `json:"routeArn"` //nolint: staticcheck
IdentitySource []string `json:"identitySource"`
RouteKey string `json:"routeKey"`
RawPath string `json:"rawPath"`
Expand Down Expand Up @@ -372,13 +372,13 @@ type APIGatewayCustomAuthorizerRequestTypeRequestContext struct {
type APIGatewayCustomAuthorizerRequest struct {
Type string `json:"type"`
AuthorizationToken string `json:"authorizationToken"`
MethodArn string `json:"methodArn"` //nolint: stylecheck
MethodArn string `json:"methodArn"` //nolint: staticcheck
}

// APIGatewayCustomAuthorizerRequestTypeRequest contains data coming in to a custom API Gateway authorizer function.
type APIGatewayCustomAuthorizerRequestTypeRequest struct {
Type string `json:"type"`
MethodArn string `json:"methodArn"` //nolint: stylecheck
MethodArn string `json:"methodArn"` //nolint: staticcheck
Resource string `json:"resource"`
Path string `json:"path"`
HTTPMethod string `json:"httpMethod"`
Expand Down
2 changes: 1 addition & 1 deletion events/attributevalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type DynamoDBAttributeValue struct {

// This struct represents DynamoDBAttributeValue which doesn't
// implement fmt.Stringer interface and safely `fmt.Sprintf`able
type dynamoDbAttributeValue DynamoDBAttributeValue //nolint: stylecheck
type dynamoDbAttributeValue DynamoDBAttributeValue //nolint: staticcheck

// Binary provides access to an attribute of type Binary.
// Method panics if the attribute is not of type Binary.
Expand Down
2 changes: 1 addition & 1 deletion events/code_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ type CodeCommitRecord struct {
EventPartNumber uint64 `json:"eventPartNumber"`
CodeCommit CodeCommitCodeCommit `json:"codecommit"`
EventName string `json:"eventName"`
EventTriggerConfigId string `json:"eventTriggerConfigId"` //nolint: stylecheck
EventTriggerConfigId string `json:"eventTriggerConfigId"` //nolint: staticcheck
EventSourceARN string `json:"eventSourceARN"`
UserIdentityARN string `json:"userIdentityARN"`
EventSource string `json:"eventSource"`
Expand Down
6 changes: 3 additions & 3 deletions events/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ type ConfigEvent struct {
// The ID of the AWS account that owns the rule
AccountID string `json:"accountId"`
// The ARN that AWS Config assigned to the rule
ConfigRuleArn string `json:"configRuleArn"` //nolint:stylecheck
ConfigRuleID string `json:"configRuleId"` //nolint:stylecheck
ConfigRuleArn string `json:"configRuleArn"` //nolint:staticcheck
ConfigRuleID string `json:"configRuleId"` //nolint:staticcheck
// The name that you assigned to the rule that caused AWS Config to publish the event
ConfigRuleName string `json:"configRuleName"`
// A boolean value that indicates whether the AWS resource to be evaluated has been removed from the rule's scope
EventLeftScope bool `json:"eventLeftScope"`
ExecutionRoleArn string `json:"executionRoleArn"` //nolint:stylecheck
ExecutionRoleArn string `json:"executionRoleArn"` //nolint:staticcheck
// If the event is published in response to a resource configuration change, this value contains a JSON configuration item
InvokingEvent string `json:"invokingEvent"`
// A token that the function must pass to AWS Config with the PutEvaluations call
Expand Down
2 changes: 1 addition & 1 deletion events/dynamodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type DynamoDBEventRecord struct {
EventVersion string `json:"eventVersion"`

// The event source ARN of DynamoDB
EventSourceArn string `json:"eventSourceARN"` //nolint: stylecheck
EventSourceArn string `json:"eventSourceARN"` //nolint: staticcheck

// Items that are deleted by the Time to Live process after expiration have
// the following fields:
Expand Down
4 changes: 2 additions & 2 deletions events/firehose.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package events
// KinesisFirehoseEvent represents the input event from Amazon Kinesis Firehose. It is used as the input parameter.
type KinesisFirehoseEvent struct {
InvocationID string `json:"invocationId"`
DeliveryStreamArn string `json:"deliveryStreamArn"` //nolint: stylecheck
SourceKinesisStreamArn string `json:"sourceKinesisStreamArn"` //nolint: stylecheck
DeliveryStreamArn string `json:"deliveryStreamArn"` //nolint: staticcheck
SourceKinesisStreamArn string `json:"sourceKinesisStreamArn"` //nolint: staticcheck
Region string `json:"region"`
Records []KinesisFirehoseEventRecord `json:"records"`
}
Expand Down
6 changes: 3 additions & 3 deletions events/kinesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ type KinesisTimeWindowEventResponse struct {
}

type KinesisEventRecord struct {
AwsRegion string `json:"awsRegion"` //nolint: stylecheck
AwsRegion string `json:"awsRegion"` //nolint: staticcheck
EventID string `json:"eventID"`
EventName string `json:"eventName"`
EventSource string `json:"eventSource"`
EventSourceArn string `json:"eventSourceARN"` //nolint: stylecheck
EventSourceArn string `json:"eventSourceARN"` //nolint: staticcheck
EventVersion string `json:"eventVersion"`
InvokeIdentityArn string `json:"invokeIdentityArn"` //nolint: stylecheck
InvokeIdentityArn string `json:"invokeIdentityArn"` //nolint: staticcheck
Kinesis KinesisRecord `json:"kinesis"`
}

Expand Down
2 changes: 1 addition & 1 deletion events/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type S3Entity struct {
type S3Bucket struct {
Name string `json:"name"`
OwnerIdentity S3UserIdentity `json:"ownerIdentity"`
Arn string `json:"arn"` //nolint: stylecheck
Arn string `json:"arn"` //nolint: staticcheck
}

type S3Object struct {
Expand Down
Loading
Loading