Skip to content

Latest commit

 

History

History
33 lines (30 loc) · 984 Bytes

File metadata and controls

33 lines (30 loc) · 984 Bytes

Migration guide

v2

  • aws/aws-sdk-go is updated to aws/aws-sdk-go-v2
    • 🔄Create s3sync client with aws.Config
       import (
      -  "github.com/aws/aws-sdk-go/aws/session"
      -  "github.com/seqsense/s3sync"
      +  "github.com/aws/aws-sdk-go-v2/config"
      +  "github.com/seqsense/s3sync/v2"
       )
      
      -sess, err := session.NewSession()
      +cfg, err := config.LoadDefaultConfig(ctx)
       if err != nil {
         // error handling
       }
      -syncManager := s3sync.New(sess)
      +syncManager := s3sync.New(cfg)
  • Sync() requires context by default and SyncWithContext() is removed
    • 🔄Pass ctx to Sync()
      -syncManager.Sync("s3://bucket/key", "local/path")
      +syncManager.Sync(ctx, "s3://bucket/key", "local/path")
    • 🔄Use Sync() instead of SyncWithContext()
      -syncManager.SyncWithContext(ctx, "s3://bucket/key", "local/path")
      +syncManager.Sync(ctx, "s3://bucket/key", "local/path")