diff --git a/services/httpd/response_writer.go b/services/httpd/response_writer.go index 477d1d901d..c59535d57f 100644 --- a/services/httpd/response_writer.go +++ b/services/httpd/response_writer.go @@ -162,6 +162,8 @@ func (w *csvFormatter) WriteResponse(resp Response) (n int, err error) { w.columns[i+2] = strconv.FormatFloat(v, 'f', -1, 64) case int64: w.columns[i+2] = strconv.FormatInt(v, 10) + case uint64: + w.columns[i+2] = strconv.FormatUint(v, 10) case string: w.columns[i+2] = v case bool: diff --git a/services/httpd/response_writer_test.go b/services/httpd/response_writer_test.go index 72f183f345..e74781b0bb 100644 --- a/services/httpd/response_writer_test.go +++ b/services/httpd/response_writer_test.go @@ -1,6 +1,7 @@ package httpd_test import ( + "math" "net/http" "net/http/httptest" "net/url" @@ -41,6 +42,7 @@ func TestResponseWriter_CSV(t *testing.T) { {time.Unix(0, 40), "foobar"}, {time.Unix(0, 50), true}, {time.Unix(0, 60), false}, + {time.Unix(0, 70), uint64(math.MaxInt64 + 1)}, }, }, }, @@ -55,6 +57,7 @@ cpu,"host=server01,region=uswest",30, cpu,"host=server01,region=uswest",40,foobar cpu,"host=server01,region=uswest",50,true cpu,"host=server01,region=uswest",60,false +cpu,"host=server01,region=uswest",70,9223372036854775808 `; got != want { t.Errorf("unexpected output:\n\ngot=%v\nwant=%s", got, want) }