diff --git a/client/v2/client.go b/client/v2/client.go index d1a4b8150..7902b9c20 100644 --- a/client/v2/client.go +++ b/client/v2/client.go @@ -521,14 +521,14 @@ type simpleHTTPClient struct { headerTimeout time.Duration } -// NoRequestError indicates that the HTTPRequest object could not be found +// ErrNoRequest indicates that the HTTPRequest object could not be found // or was nil. No processing could continue. -var NoRequestError = errors.New("No HTTPRequest was available") +var ErrNoRequest = errors.New("No HTTPRequest was available") func (c *simpleHTTPClient) Do(ctx context.Context, act httpAction) (*http.Response, []byte, error) { req := act.HTTPRequest(c.endpoint) if req == nil { - return nil, nil, NoRequestError + return nil, nil, ErrNoRequest } if err := printcURL(req); err != nil { diff --git a/client/v2/client_test.go b/client/v2/client_test.go index 7b64d1449..7f0d807e7 100644 --- a/client/v2/client_test.go +++ b/client/v2/client_test.go @@ -171,7 +171,7 @@ func TestSimpleHTTPClientDoNilRequest(t *testing.T) { tr.errchan <- errors.New("fixture") _, _, err := c.Do(context.Background(), &nilAction{}) - if err != NoRequestError { + if err != ErrNoRequest { t.Fatalf("expected non-nil error, got nil") } }