// download txDir/name from s3 bucket and save it to $PWD/name
download txDir/name from s3 bucket and save it to $PWD/name
// download txDir / name from s3 bucket and save it to $PWD / name
func awsDownload(sess *session.Session, conf AWS, txDir, name string) (*os.File, error) {
	file, err := os.Create(name)
	if err != nil {
		return nil, err
	}
	defer file.Close()
	downloader := s3manager.NewDownloader(sess)
	numBytes, err := downloader.Download(file,
		&s3.GetObjectInput{
			Bucket: aws.String(conf.Bucket),
			Key:    aws.String(filepath.Join(txDir, name)),
		})
	if err != nil {
		return nil, err
	}
	_ = numBytes
	return file, nil
}
func awsDownload ( sess * session . Session , conf AWS , txDir , name string ) ( * os . File , error ) { file , err := os . Create ( name ) if err != nil { return nil , err } defer file . Close ( ) downloader := s3manager . NewDownloader ( sess ) numBytes , err := downloader . Download ( file , & s3 . GetObjectInput { Bucket : aws . String ( conf . Bucket ) , Key : aws . String ( filepath . Join ( txDir , name ) ) , } ) if err != nil { return nil , err } _ = numBytes return file , nil }
download txDir/name from s3 bucket and save it to $PWD/name
download txDir / name from s3 bucket and save it to $PWD / name