From f2be5c86c8f0aac7d901ba64f55cecba7b9adb7a Mon Sep 17 00:00:00 2001 From: Matt Larraz Date: Sat, 29 Oct 2022 15:05:28 -0400 Subject: [PATCH] Stop using deprecated aws function Call NewSession (which can return an error) instead of New --- sqs_client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sqs_client.go b/sqs_client.go index a8b3b37..5f9fca2 100644 --- a/sqs_client.go +++ b/sqs_client.go @@ -33,7 +33,11 @@ type sdkClient struct { // NewAWSSQSClient creates an SQS client that talks to AWS on the given queue func NewAWSSQSClient(conf AWSConfig, queueName string) (SQSClient, error) { creds := credentials.NewStaticCredentials(conf.AccessKey, conf.SecretKey, "") - sess := session.New(&aws.Config{Region: formatRegion(conf.Region), Credentials: creds}) + sess, err := session.NewSession(&aws.Config{Region: formatRegion(conf.Region), Credentials: creds}) + + if err != nil { + return nil, err + } client := new(sdkClient) client.service = sqs.New(sess)