From f9ea5430726449fbf2ad2866f2e67ba27b9e5477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Goli=C5=84ski?= Date: Fri, 1 Mar 2024 19:03:56 +0100 Subject: [PATCH] wrap one more error and remove unused functions --- internal/spacelift/client/client.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/internal/spacelift/client/client.go b/internal/spacelift/client/client.go index 1fb7eb6..226876a 100644 --- a/internal/spacelift/client/client.go +++ b/internal/spacelift/client/client.go @@ -2,7 +2,6 @@ package client import ( "context" - "net/http" "github.com/pkg/errors" "github.com/shurcooL/graphql" @@ -64,7 +63,7 @@ func New(endpoint, keyID, keySecret string) (*client, error) { session, err := session.FromAPIKey(ctx, httpClient)(endpoint, keyID, keySecret) if err != nil { - return nil, err + return nil, errors.Wrap(err, "failed to create spacelift session") } spaceliftClient := spacectl.New(httpClient, session) @@ -79,11 +78,3 @@ func (c *client) Mutate(ctx context.Context, mutation interface{}, variables map func (c *client) Query(ctx context.Context, query interface{}, variables map[string]interface{}, opts ...graphql.RequestOption) error { return c.wraps.Query(ctx, query, variables, opts...) } - -func (c *client) URL(format string, a ...interface{}) string { - return c.wraps.URL(format, a...) -} - -func (c *client) Do(req *http.Request) (*http.Response, error) { - return c.wraps.Do(req) -}