Use go 1.26 syntax

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-06 15:00:42 +01:00
parent 54f80596b6
commit d4b3025463
28 changed files with 136 additions and 167 deletions

View File

@@ -22,7 +22,6 @@ import (
"net/url"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
@@ -52,8 +51,8 @@ func (s *Service) GetFileBase64(
result, err := s.s3Client.GetObject(
ctx,
&s3.GetObjectInput{
Bucket: aws.String(file.GetBucketName()),
Key: aws.String(file.GetObjectKey()),
Bucket: new(file.GetBucketName()),
Key: new(file.GetObjectKey()),
},
)
if err != nil {
@@ -84,8 +83,8 @@ func (s *Service) GetFileBytes(
result, err := s.s3Client.GetObject(
ctx,
&s3.GetObjectInput{
Bucket: aws.String(file.GetBucketName()),
Key: aws.String(file.GetObjectKey()),
Bucket: new(file.GetBucketName()),
Key: new(file.GetObjectKey()),
},
)
if err != nil {
@@ -129,11 +128,11 @@ func (s *Service) PutFile(
_, err := s.s3Client.PutObject(
ctx,
&s3.PutObjectInput{
Bucket: aws.String(file.GetBucketName()),
Key: aws.String(file.GetObjectKey()),
Bucket: new(file.GetBucketName()),
Key: new(file.GetObjectKey()),
Body: content,
ContentType: aws.String(file.GetMimeType()),
CacheControl: aws.String("private, max-age=3600"),
ContentType: new(file.GetMimeType()),
CacheControl: new("private, max-age=3600"),
Metadata: metadata,
},
)
@@ -144,8 +143,8 @@ func (s *Service) PutFile(
headOutput, err := s.s3Client.HeadObject(
ctx,
&s3.HeadObjectInput{
Bucket: aws.String(file.GetBucketName()),
Key: aws.String(file.GetObjectKey()),
Bucket: new(file.GetBucketName()),
Key: new(file.GetObjectKey()),
},
)
if err != nil {
@@ -169,10 +168,10 @@ func (s *Service) GenerateFileUrl(
presignedReq, err := presignClient.PresignGetObject(
ctx,
&s3.GetObjectInput{
Bucket: aws.String(file.GetBucketName()),
Key: aws.String(file.GetObjectKey()),
ResponseCacheControl: aws.String("max-age=3600, public"),
ResponseContentType: aws.String(file.GetMimeType()),
Bucket: new(file.GetBucketName()),
Key: new(file.GetObjectKey()),
ResponseCacheControl: new("max-age=3600, public"),
ResponseContentType: new(file.GetMimeType()),
ResponseContentDisposition: &contentDisposition,
},
func(opts *s3.PresignOptions) {