mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
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:
parent
7d02ce2073
commit
6998c5641c
@ -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 {
|
||||
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user