From 91f45342c4ff29a24c61812d539ac745dbb1570a Mon Sep 17 00:00:00 2001 From: John Cai Date: Mon, 4 May 2020 10:59:49 -0700 Subject: Move gitlabnet client to client package --- internal/gitlabnet/discover/client.go | 3 ++- internal/gitlabnet/discover/client_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'internal/gitlabnet/discover') diff --git a/internal/gitlabnet/discover/client.go b/internal/gitlabnet/discover/client.go index 3faef53..d1e1906 100644 --- a/internal/gitlabnet/discover/client.go +++ b/internal/gitlabnet/discover/client.go @@ -5,6 +5,7 @@ import ( "net/http" "net/url" + "gitlab.com/gitlab-org/gitlab-shell/client" "gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs" "gitlab.com/gitlab-org/gitlab-shell/internal/config" "gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet" @@ -12,7 +13,7 @@ import ( type Client struct { config *config.Config - client *gitlabnet.GitlabClient + client *client.GitlabNetClient } type Response struct { diff --git a/internal/gitlabnet/discover/client_test.go b/internal/gitlabnet/discover/client_test.go index 66e234b..96b3162 100644 --- a/internal/gitlabnet/discover/client_test.go +++ b/internal/gitlabnet/discover/client_test.go @@ -7,12 +7,12 @@ import ( "net/url" "testing" - "gitlab.com/gitlab-org/gitlab-shell/internal/config" - "gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet" - "gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/testserver" + "gitlab.com/gitlab-org/gitlab-shell/client" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "gitlab.com/gitlab-org/gitlab-shell/client/testserver" + "gitlab.com/gitlab-org/gitlab-shell/internal/config" ) var ( @@ -40,7 +40,7 @@ func init() { json.NewEncoder(w).Encode(body) } else if r.URL.Query().Get("username") == "broken_message" { w.WriteHeader(http.StatusForbidden) - body := &gitlabnet.ErrorResponse{ + body := &client.ErrorResponse{ Message: "Not allowed!", } json.NewEncoder(w).Encode(body) -- cgit v1.2.1