adjust test code

This commit is contained in:
Chris Lu 2021-09-26 12:59:49 -07:00
parent 603ea2db73
commit ecaab0e048

View file

@ -19,10 +19,10 @@ import (
const ( const (
maxPartSize = int64(5 * 1024 * 1024) maxPartSize = int64(5 * 1024 * 1024)
maxRetries = 3 maxRetries = 3
awsAccessKeyID = "Your access key" awsAccessKeyID = "any"
awsSecretAccessKey = "Your secret key" awsSecretAccessKey = "any"
awsBucketRegion = "S3 bucket region" awsBucketRegion = "uswest1"
awsBucketName = "newBucket" awsBucketName = "bucket1"
) )
var ( var (
@ -37,7 +37,7 @@ func main() {
if err != nil { if err != nil {
fmt.Printf("bad credentials: %s", err) fmt.Printf("bad credentials: %s", err)
} }
cfg := aws.NewConfig().WithRegion(awsBucketRegion).WithCredentials(creds).WithDisableSSL(true).WithEndpoint("localhost:8333") cfg := aws.NewConfig().WithRegion(awsBucketRegion).WithCredentials(creds).WithDisableSSL(true).WithEndpoint("localhost:8333").WithS3ForcePathStyle(true)
svc := s3.New(session.New(), cfg) svc := s3.New(session.New(), cfg)
file, err := os.Open(*filename) file, err := os.Open(*filename)