From 44e56b30b63e9465b1aef291662d760698142774 Mon Sep 17 00:00:00 2001 From: David van der Spek Date: Tue, 16 May 2023 12:25:47 +0200 Subject: [PATCH] fix: remove unused sess Signed-off-by: David van der Spek --- registry/storage/driver/s3-aws/s3.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/registry/storage/driver/s3-aws/s3.go b/registry/storage/driver/s3-aws/s3.go index cbe6f7083..083d21d29 100644 --- a/registry/storage/driver/s3-aws/s3.go +++ b/registry/storage/driver/s3-aws/s3.go @@ -403,10 +403,6 @@ func New(params DriverParameters) (*Driver, error) { } awsConfig := aws.NewConfig() - sess, err := session.NewSession() - if err != nil { - return nil, fmt.Errorf("failed to create new session: %v", err) - } if params.AccessKey != "" && params.SecretKey != "" { creds := credentials.NewStaticCredentials( params.AccessKey, @@ -442,7 +438,7 @@ func New(params DriverParameters) (*Driver, error) { } } - sess, err = session.NewSession(awsConfig) + sess, err := session.NewSession(awsConfig) if err != nil { return nil, fmt.Errorf("failed to create new session with aws config: %v", err) }