From 96e81c2fbc7d094e57b11676d39843cc951a53f8 Mon Sep 17 00:00:00 2001 From: Greg Zapp Date: Fri, 8 Aug 2014 14:36:34 +1200 Subject: [PATCH] These lines need to be moved so the NextToken makes it into the request properly --- cloudwatch/cloudwatch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloudwatch/cloudwatch.go b/cloudwatch/cloudwatch.go index 38fb89a3..ce9e21a9 100644 --- a/cloudwatch/cloudwatch.go +++ b/cloudwatch/cloudwatch.go @@ -283,9 +283,9 @@ func (c *CloudWatch) ListMetrics(req *ListMetricsRequest) (result *ListMetricsRe err = c.query("GET", "/", params, &result) metrics := result.ListMetricsResult.Metrics if result.ListMetricsResult.NextToken != "" { - params = aws.MakeParams("ListMetrics") - params["NextToken"] = result.ListMetricsResult.NextToken for result.ListMetricsResult.NextToken != "" && err == nil { + params = aws.MakeParams("ListMetrics") + params["NextToken"] = result.ListMetricsResult.NextToken result = new(ListMetricsResponse) err = c.query("GET", "/", params, &result) if err == nil {