Fixed errors found by lint.

Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
This commit is contained in:
Bartek Plotka 2019-07-29 20:07:01 +01:00
parent 1e585e090a
commit 8f1b9cafc6

View file

@ -221,18 +221,18 @@ func TestNegotiateResponseType(t *testing.T) {
testutil.Ok(t, err) testutil.Ok(t, err)
testutil.Equals(t, prompb.ReadRequest_STREAMED_XOR_CHUNKS, r) testutil.Equals(t, prompb.ReadRequest_STREAMED_XOR_CHUNKS, r)
r, err = NegotiateResponseType([]prompb.ReadRequest_ResponseType{ r2, err := NegotiateResponseType([]prompb.ReadRequest_ResponseType{
prompb.ReadRequest_SAMPLED, prompb.ReadRequest_SAMPLED,
prompb.ReadRequest_STREAMED_XOR_CHUNKS, prompb.ReadRequest_STREAMED_XOR_CHUNKS,
}) })
testutil.Ok(t, err) testutil.Ok(t, err)
testutil.Equals(t, prompb.ReadRequest_SAMPLED, r) testutil.Equals(t, prompb.ReadRequest_SAMPLED, r2)
r, err = NegotiateResponseType([]prompb.ReadRequest_ResponseType{}) r3, err := NegotiateResponseType([]prompb.ReadRequest_ResponseType{})
testutil.Ok(t, err) testutil.Ok(t, err)
testutil.Equals(t, prompb.ReadRequest_SAMPLED, r) testutil.Equals(t, prompb.ReadRequest_SAMPLED, r3)
r, err = NegotiateResponseType([]prompb.ReadRequest_ResponseType{20}) _, err = NegotiateResponseType([]prompb.ReadRequest_ResponseType{20})
testutil.NotOk(t, err, "expected error due to not supported requested response types") testutil.NotOk(t, err, "expected error due to not supported requested response types")
testutil.Equals(t, "server does not support any of the requested response types: [20]; supported: map[SAMPLED:{} STREAMED_XOR_CHUNKS:{}]", err.Error()) testutil.Equals(t, "server does not support any of the requested response types: [20]; supported: map[SAMPLED:{} STREAMED_XOR_CHUNKS:{}]", err.Error())
} }