client v2: rename error var for revive

The revive tool complained durring the build.  Error variable has been
renamed.

Fixes #12718

Signed-off-by: David Lanouette <David.Lanouette@GMail.com>
This commit is contained in:
David Lanouette 2021-03-01 17:00:23 -05:00
parent 7d02ce2073
commit 6998c5641c
2 changed files with 4 additions and 4 deletions

View File

@ -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 {

View File

@ -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")
}
}