From 4db9faa1f9b92f05e2d20611e8e6281e87f890d7 Mon Sep 17 00:00:00 2001 From: Murad Biashimov Date: Fri, 9 Feb 2024 10:36:41 +0100 Subject: [PATCH] fix(logger): convert multierror to err --- client.go | 2 +- client_test.go | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index cb2fb69..07ab3e9 100644 --- a/client.go +++ b/client.go @@ -99,7 +99,7 @@ func (d *aivenClient) Do(ctx context.Context, operationID, method, path string, } defer func() { - err = multierror.Append(rsp.Body.Close()) + err = multierror.Append(rsp.Body.Close()).ErrorOrNil() }() b, err := io.ReadAll(rsp.Body) diff --git a/client_test.go b/client_test.go index 2dfd156..2ea60dc 100644 --- a/client_test.go +++ b/client_test.go @@ -34,3 +34,18 @@ func TestNewClient(t *testing.T) { assert.Equal(t, 1, found) } + +func TestProjectGetServiceLogs(t *testing.T) { + token := os.Getenv("AIVEN_TOKEN") + if token == "" { + t.Skip("token is required for the test") + } + + c, err := NewClient(DebugOpt(true)) + require.NoError(t, err) + + ctx := context.Background() + out, err := c.ServiceGet(ctx, "dev-sandbox", "gordon-gf") + assert.Nil(t, err) + assert.NotNil(t, out) +}