From 436eb0e591a8e2ede5f999fad9c960f5b713bb8a Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 24 Nov 2023 21:55:09 +0800 Subject: [PATCH] chore: tweak s3 comments --- plugin/storage/s3/s3.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/storage/s3/s3.go b/plugin/storage/s3/s3.go index d7c2a9d3..50277b75 100644 --- a/plugin/storage/s3/s3.go +++ b/plugin/storage/s3/s3.go @@ -64,17 +64,17 @@ func NewClient(ctx context.Context, config *Config) (*Client, error) { func (client *Client) UploadFile(ctx context.Context, filename string, fileType string, src io.Reader) (string, error) { uploader := manager.NewUploader(client.Client) - // set ACL according to if user set prefix - obj := awss3.PutObjectInput{ + putInput := awss3.PutObjectInput{ Bucket: aws.String(client.Config.Bucket), Key: aws.String(filename), Body: src, ContentType: aws.String(fileType), } + // Set ACL according to if url prefix is set. if client.Config.URLPrefix == "" { - obj.ACL = types.ObjectCannedACL(*aws.String("public-read")) + putInput.ACL = types.ObjectCannedACL(*aws.String("public-read")) } - uploadOutput, err := uploader.Upload(ctx, &obj) + uploadOutput, err := uploader.Upload(ctx, &putInput) if err != nil { return "", err }