github.com/aavshr/aws-sdk-go@v1.41.3/aws/request/request_context_1_6.go (about)

     1  //go:build !go1.7
     2  // +build !go1.7
     3  
     4  package request
     5  
     6  import "github.com/aavshr/aws-sdk-go/aws"
     7  
     8  // setContext updates the Request to use the passed in context for cancellation.
     9  // Context will also be used for request retry delay.
    10  //
    11  // Creates shallow copy of the http.Request with the WithContext method.
    12  func setRequestContext(r *Request, ctx aws.Context) {
    13  	r.context = ctx
    14  	r.HTTPRequest.Cancel = ctx.Done()
    15  }