Omit zero value query time

This commit is contained in:
Ilia Choly 2017-11-16 16:39:52 -05:00
parent 5cec1d0429
commit a132856ffd
1 changed files with 3 additions and 1 deletions

View File

@ -138,7 +138,9 @@ func (h *httpAPI) Query(ctx context.Context, query string, ts time.Time) (model.
q := u.Query()
q.Set("query", query)
if !ts.IsZero() {
q.Set("time", ts.Format(time.RFC3339Nano))
}
u.RawQuery = q.Encode()