tempodb/tempodb-go — pull request #5 by karlseguin (2013-11-25 12:48:09+00:00)
Title: Refactoring

3 things going on

1 - Rework makeRequest and buildUrl to take care of many of the repetitive code which every function was implementing. As part of this, Close the response body, which must be done in order for it to be re-used by keepalive (**Callers should close resp.Body when done reading from it. If resp.Body is not closed, the Client's underlying RoundTripper (typically Transport) may not be able to re-use a persistent TCP connection to the server for a subsequent "keep-alive" request.**)

2 - Cleanup the models so that we don't have a bunch of needless private structures.

3 - Various small tweaks - don't allocate 0-length arrays everywhere, don't use meaningless variables names (TS, V) and so on.

All the tests pass, but I've only done a bit of manual integration testing. Worth doing more. Also, I don't find the library particularly usable...it's very....tedious to create the datapoints and so on. Hoping to look into that when I have a bit of time, wanted to get this out first.