From 6f1d5b1221fc9560a7db68c762d83d245ca95ad1 Mon Sep 17 00:00:00 2001 From: maruware Date: Fri, 22 Mar 2019 19:58:40 +0900 Subject: [PATCH] handle put object err --- s3.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/s3.go b/s3.go index 675b512..df6552c 100644 --- a/s3.go +++ b/s3.go @@ -62,13 +62,16 @@ func syncObject(svc *s3.S3, bucket *string, filePath string, contentType string, return false, err } - svc.PutObject(&s3.PutObjectInput{ + _, err = svc.PutObject(&s3.PutObjectInput{ Bucket: bucket, Key: &key, Body: f, ContentType: &contentType, ACL: aws.String("public-read"), }) + if err != nil { + return false, err + } fmt.Println("[Put]", key)