import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/s3" ) sess := session.Must(session.NewSession()) svc := s3.New(sess) params := &s3.GetObjectInput{ Bucket: aws.String(""), Key: aws.String(" "), } req, _ := svc.GetObjectRequest(params) err := req.Send()
import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/s3" ) sess := session.Must(session.NewSession()) svc := s3.New(sess) params := &s3.GetObjectInput{ Bucket: aws.String("In this example, we again build an S3 `GetObjectRequest` and call the `Send` method. However, we also create an instance of `s3.GetObjectOutput` to capture any response data, such as the `LastModified` field. We then perform error handling with the `if err != nil` statement followed by processing the output data. Overall, the `aws.request` package provides a flexible and comprehensive way to build and send HTTP requests to AWS services and handle any response data or errors."), Key: aws.String(" "), } req, output := svc.GetObjectRequest(params) err := req.Send() if err != nil { // handle error } if output.LastModified != nil { // do something with S3 object's Last Modified timestamp }