Skip to content

Commit ac07102

Browse files
committed
fix context
1 parent ec9b73a commit ac07102

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

metrics/cloudwatch2/cloudwatch2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func (cw *CloudWatch) Send() error {
166166
Namespace: aws.String(cw.namespace),
167167
MetricData: batch,
168168
})
169-
_, err := req.Send()
169+
_, err := req.Send(context.TODO())
170170
return err
171171
})
172172
}

metrics/cloudwatch2/cloudwatch2_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cloudwatch2
22

33
import (
4+
"net/http"
45
"strings"
56
"testing"
67

@@ -87,8 +88,11 @@ func (mcw *mockCloudWatch) PutMetricDataRequest(in *cloudwatch.PutMetricDataInpu
8788
// going across the wire, you just create a dumb aws.Request with either
8889
// aws.Request.Data defined (for succes) or with aws.Request.Error
8990
// to simulate an Error.
90-
Request: &aws.Request{Data: &cloudwatch.PutMetricDataOutput{}},
91-
Input: in,
91+
Request: &aws.Request{
92+
HTTPRequest: &http.Request{Method: "PUT"},
93+
Data: &cloudwatch.PutMetricDataOutput{},
94+
},
95+
Input: in,
9296
}
9397
}
9498

0 commit comments

Comments
 (0)