From f4a5f82312377b267762f923af625933c7d00a51 Mon Sep 17 00:00:00 2001 From: Jose Garcia Date: Thu, 30 Sep 2021 10:34:27 -0400 Subject: [PATCH 1/2] Move internal/liveshare to pkg/liveshare --- cmd/ghcs/logs.go | 2 +- cmd/ghcs/ports.go | 2 +- cmd/ghcs/ssh.go | 2 +- internal/codespaces/codespaces.go | 2 +- internal/codespaces/states.go | 2 +- {internal => pkg}/liveshare/client.go | 0 {internal => pkg}/liveshare/client_test.go | 0 {internal => pkg}/liveshare/options_test.go | 0 {internal => pkg}/liveshare/port_forwarder.go | 0 {internal => pkg}/liveshare/port_forwarder_test.go | 0 {internal => pkg}/liveshare/rpc.go | 0 {internal => pkg}/liveshare/session.go | 0 {internal => pkg}/liveshare/session_test.go | 0 {internal => pkg}/liveshare/socket.go | 0 {internal => pkg}/liveshare/ssh.go | 0 {internal => pkg}/liveshare/test/server.go | 0 {internal => pkg}/liveshare/test/socket.go | 0 17 files changed, 5 insertions(+), 5 deletions(-) rename {internal => pkg}/liveshare/client.go (100%) rename {internal => pkg}/liveshare/client_test.go (100%) rename {internal => pkg}/liveshare/options_test.go (100%) rename {internal => pkg}/liveshare/port_forwarder.go (100%) rename {internal => pkg}/liveshare/port_forwarder_test.go (100%) rename {internal => pkg}/liveshare/rpc.go (100%) rename {internal => pkg}/liveshare/session.go (100%) rename {internal => pkg}/liveshare/session_test.go (100%) rename {internal => pkg}/liveshare/socket.go (100%) rename {internal => pkg}/liveshare/ssh.go (100%) rename {internal => pkg}/liveshare/test/server.go (100%) rename {internal => pkg}/liveshare/test/socket.go (100%) diff --git a/cmd/ghcs/logs.go b/cmd/ghcs/logs.go index 24d017e58..0e5a7704d 100644 --- a/cmd/ghcs/logs.go +++ b/cmd/ghcs/logs.go @@ -6,7 +6,7 @@ import ( "net" "github.com/cli/cli/v2/internal/codespaces" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/pkg/liveshare" "github.com/spf13/cobra" ) diff --git a/cmd/ghcs/ports.go b/cmd/ghcs/ports.go index 27467d150..b0bdb35f1 100644 --- a/cmd/ghcs/ports.go +++ b/cmd/ghcs/ports.go @@ -14,7 +14,7 @@ import ( "github.com/cli/cli/v2/cmd/ghcs/output" "github.com/cli/cli/v2/internal/api" "github.com/cli/cli/v2/internal/codespaces" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/pkg/liveshare" "github.com/muhammadmuzzammil1998/jsonc" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" diff --git a/cmd/ghcs/ssh.go b/cmd/ghcs/ssh.go index 5627952b6..1a3d48335 100644 --- a/cmd/ghcs/ssh.go +++ b/cmd/ghcs/ssh.go @@ -6,7 +6,7 @@ import ( "net" "github.com/cli/cli/v2/internal/codespaces" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/pkg/liveshare" "github.com/spf13/cobra" ) diff --git a/internal/codespaces/codespaces.go b/internal/codespaces/codespaces.go index f127cb362..9d2fe06e5 100644 --- a/internal/codespaces/codespaces.go +++ b/internal/codespaces/codespaces.go @@ -7,7 +7,7 @@ import ( "time" "github.com/cli/cli/v2/internal/api" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/pkg/liveshare" ) type logger interface { diff --git a/internal/codespaces/states.go b/internal/codespaces/states.go index 7bd53b5e0..4aca1b566 100644 --- a/internal/codespaces/states.go +++ b/internal/codespaces/states.go @@ -10,7 +10,7 @@ import ( "time" "github.com/cli/cli/v2/internal/api" - "github.com/cli/cli/v2/internal/liveshare" + "github.com/cli/cli/v2/pkg/liveshare" ) // PostCreateStateStatus is a string value representing the different statuses a state can have. diff --git a/internal/liveshare/client.go b/pkg/liveshare/client.go similarity index 100% rename from internal/liveshare/client.go rename to pkg/liveshare/client.go diff --git a/internal/liveshare/client_test.go b/pkg/liveshare/client_test.go similarity index 100% rename from internal/liveshare/client_test.go rename to pkg/liveshare/client_test.go diff --git a/internal/liveshare/options_test.go b/pkg/liveshare/options_test.go similarity index 100% rename from internal/liveshare/options_test.go rename to pkg/liveshare/options_test.go diff --git a/internal/liveshare/port_forwarder.go b/pkg/liveshare/port_forwarder.go similarity index 100% rename from internal/liveshare/port_forwarder.go rename to pkg/liveshare/port_forwarder.go diff --git a/internal/liveshare/port_forwarder_test.go b/pkg/liveshare/port_forwarder_test.go similarity index 100% rename from internal/liveshare/port_forwarder_test.go rename to pkg/liveshare/port_forwarder_test.go diff --git a/internal/liveshare/rpc.go b/pkg/liveshare/rpc.go similarity index 100% rename from internal/liveshare/rpc.go rename to pkg/liveshare/rpc.go diff --git a/internal/liveshare/session.go b/pkg/liveshare/session.go similarity index 100% rename from internal/liveshare/session.go rename to pkg/liveshare/session.go diff --git a/internal/liveshare/session_test.go b/pkg/liveshare/session_test.go similarity index 100% rename from internal/liveshare/session_test.go rename to pkg/liveshare/session_test.go diff --git a/internal/liveshare/socket.go b/pkg/liveshare/socket.go similarity index 100% rename from internal/liveshare/socket.go rename to pkg/liveshare/socket.go diff --git a/internal/liveshare/ssh.go b/pkg/liveshare/ssh.go similarity index 100% rename from internal/liveshare/ssh.go rename to pkg/liveshare/ssh.go diff --git a/internal/liveshare/test/server.go b/pkg/liveshare/test/server.go similarity index 100% rename from internal/liveshare/test/server.go rename to pkg/liveshare/test/server.go diff --git a/internal/liveshare/test/socket.go b/pkg/liveshare/test/socket.go similarity index 100% rename from internal/liveshare/test/socket.go rename to pkg/liveshare/test/socket.go From 53e4149c91711fdfac59ddb40566816936a48a9a Mon Sep 17 00:00:00 2001 From: Jose Garcia Date: Thu, 30 Sep 2021 10:42:03 -0400 Subject: [PATCH 2/2] Update tests --- pkg/liveshare/client_test.go | 2 +- pkg/liveshare/port_forwarder_test.go | 2 +- pkg/liveshare/session_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/liveshare/client_test.go b/pkg/liveshare/client_test.go index 9db20ed1c..46807a22e 100644 --- a/pkg/liveshare/client_test.go +++ b/pkg/liveshare/client_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - livesharetest "github.com/cli/cli/v2/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/pkg/liveshare/test" "github.com/sourcegraph/jsonrpc2" ) diff --git a/pkg/liveshare/port_forwarder_test.go b/pkg/liveshare/port_forwarder_test.go index eda7262c6..624428dda 100644 --- a/pkg/liveshare/port_forwarder_test.go +++ b/pkg/liveshare/port_forwarder_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - livesharetest "github.com/cli/cli/v2/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/pkg/liveshare/test" "github.com/sourcegraph/jsonrpc2" ) diff --git a/pkg/liveshare/session_test.go b/pkg/liveshare/session_test.go index 1064e490b..7f0b573b5 100644 --- a/pkg/liveshare/session_test.go +++ b/pkg/liveshare/session_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - livesharetest "github.com/cli/cli/v2/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/pkg/liveshare/test" "github.com/sourcegraph/jsonrpc2" )