From f749590e878cb985051d968b39aaf117ea469d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Tue, 28 Sep 2021 16:57:56 +0200 Subject: [PATCH] Replace old "github/ghcs" import statements --- cmd/ghcs/common.go | 6 +++--- cmd/ghcs/create.go | 6 +++--- cmd/ghcs/delete.go | 2 +- cmd/ghcs/delete_test.go | 4 ++-- cmd/ghcs/list.go | 4 ++-- cmd/ghcs/logs.go | 4 ++-- cmd/ghcs/main/main.go | 6 +++--- cmd/ghcs/mock_api.go | 2 +- cmd/ghcs/ports.go | 8 ++++---- cmd/ghcs/ssh.go | 4 ++-- go.mod | 7 +++++++ go.sum | 12 ++++++++++++ internal/codespaces/codespaces.go | 4 ++-- internal/codespaces/states.go | 4 ++-- internal/liveshare/client_test.go | 2 +- internal/liveshare/port_forwarder_test.go | 2 +- internal/liveshare/session_test.go | 2 +- 17 files changed, 49 insertions(+), 30 deletions(-) diff --git a/cmd/ghcs/common.go b/cmd/ghcs/common.go index fcdbb9f11..d69ffd964 100644 --- a/cmd/ghcs/common.go +++ b/cmd/ghcs/common.go @@ -12,8 +12,8 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/AlecAivazis/survey/v2/terminal" - "github.com/github/ghcs/cmd/ghcs/output" - "github.com/github/ghcs/internal/api" + "github.com/cli/cli/v2/cmd/ghcs/output" + "github.com/cli/cli/v2/internal/api" "github.com/spf13/cobra" "golang.org/x/term" ) @@ -162,7 +162,7 @@ func ask(qs []*survey.Question, response interface{}) error { } // checkAuthorizedKeys reports an error if the user has not registered any SSH keys; -// see https://github.com/github/ghcs/issues/166#issuecomment-921769703. +// see https://github.com/cli/cli/v2/issues/166#issuecomment-921769703. // The check is not required for security but it improves the error message. func checkAuthorizedKeys(ctx context.Context, client apiClient, user string) error { keys, err := client.AuthorizedKeys(ctx, user) diff --git a/cmd/ghcs/create.go b/cmd/ghcs/create.go index 7174e7721..c184a0ff7 100644 --- a/cmd/ghcs/create.go +++ b/cmd/ghcs/create.go @@ -8,10 +8,10 @@ import ( "strings" "github.com/AlecAivazis/survey/v2" + "github.com/cli/cli/v2/cmd/ghcs/output" + "github.com/cli/cli/v2/internal/api" + "github.com/cli/cli/v2/internal/codespaces" "github.com/fatih/camelcase" - "github.com/github/ghcs/cmd/ghcs/output" - "github.com/github/ghcs/internal/api" - "github.com/github/ghcs/internal/codespaces" "github.com/spf13/cobra" ) diff --git a/cmd/ghcs/delete.go b/cmd/ghcs/delete.go index d7fed4e68..228ed99ba 100644 --- a/cmd/ghcs/delete.go +++ b/cmd/ghcs/delete.go @@ -8,7 +8,7 @@ import ( "time" "github.com/AlecAivazis/survey/v2" - "github.com/github/ghcs/internal/api" + "github.com/cli/cli/v2/internal/api" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" ) diff --git a/cmd/ghcs/delete_test.go b/cmd/ghcs/delete_test.go index ab7b01d30..b581fdadd 100644 --- a/cmd/ghcs/delete_test.go +++ b/cmd/ghcs/delete_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/github/ghcs/cmd/ghcs/output" - "github.com/github/ghcs/internal/api" + "github.com/cli/cli/v2/cmd/ghcs/output" + "github.com/cli/cli/v2/internal/api" ) func TestDelete(t *testing.T) { diff --git a/cmd/ghcs/list.go b/cmd/ghcs/list.go index 1fc59cff0..679325eff 100644 --- a/cmd/ghcs/list.go +++ b/cmd/ghcs/list.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "github.com/github/ghcs/cmd/ghcs/output" - "github.com/github/ghcs/internal/api" + "github.com/cli/cli/v2/cmd/ghcs/output" + "github.com/cli/cli/v2/internal/api" "github.com/spf13/cobra" ) diff --git a/cmd/ghcs/logs.go b/cmd/ghcs/logs.go index 7f73d893c..24d017e58 100644 --- a/cmd/ghcs/logs.go +++ b/cmd/ghcs/logs.go @@ -5,8 +5,8 @@ import ( "fmt" "net" - "github.com/github/ghcs/internal/codespaces" - "github.com/github/ghcs/internal/liveshare" + "github.com/cli/cli/v2/internal/codespaces" + "github.com/cli/cli/v2/internal/liveshare" "github.com/spf13/cobra" ) diff --git a/cmd/ghcs/main/main.go b/cmd/ghcs/main/main.go index 7c6b2a175..455a8c302 100644 --- a/cmd/ghcs/main/main.go +++ b/cmd/ghcs/main/main.go @@ -7,9 +7,9 @@ import ( "net/http" "os" - "github.com/github/ghcs/cmd/ghcs" - "github.com/github/ghcs/cmd/ghcs/output" - "github.com/github/ghcs/internal/api" + "github.com/cli/cli/v2/cmd/ghcs" + "github.com/cli/cli/v2/cmd/ghcs/output" + "github.com/cli/cli/v2/internal/api" "github.com/spf13/cobra" ) diff --git a/cmd/ghcs/mock_api.go b/cmd/ghcs/mock_api.go index ef08c0a78..f9733e9bc 100644 --- a/cmd/ghcs/mock_api.go +++ b/cmd/ghcs/mock_api.go @@ -7,7 +7,7 @@ import ( "context" "sync" - "github.com/github/ghcs/internal/api" + "github.com/cli/cli/v2/internal/api" ) // apiClientMock is a mock implementation of apiClient. diff --git a/cmd/ghcs/ports.go b/cmd/ghcs/ports.go index 06eabad6d..27467d150 100644 --- a/cmd/ghcs/ports.go +++ b/cmd/ghcs/ports.go @@ -11,10 +11,10 @@ import ( "strconv" "strings" - "github.com/github/ghcs/cmd/ghcs/output" - "github.com/github/ghcs/internal/api" - "github.com/github/ghcs/internal/codespaces" - "github.com/github/ghcs/internal/liveshare" + "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/muhammadmuzzammil1998/jsonc" "github.com/spf13/cobra" "golang.org/x/sync/errgroup" diff --git a/cmd/ghcs/ssh.go b/cmd/ghcs/ssh.go index bda7c28bb..5627952b6 100644 --- a/cmd/ghcs/ssh.go +++ b/cmd/ghcs/ssh.go @@ -5,8 +5,8 @@ import ( "fmt" "net" - "github.com/github/ghcs/internal/codespaces" - "github.com/github/ghcs/internal/liveshare" + "github.com/cli/cli/v2/internal/codespaces" + "github.com/cli/cli/v2/internal/liveshare" "github.com/spf13/cobra" ) diff --git a/go.mod b/go.mod index 1de8b09f9..314833484 100644 --- a/go.mod +++ b/go.mod @@ -12,9 +12,11 @@ require ( github.com/cli/safeexec v1.0.0 github.com/cpuguy83/go-md2man/v2 v2.0.0 github.com/creack/pty v1.1.13 + github.com/fatih/camelcase v1.0.0 github.com/gabriel-vasile/mimetype v1.1.2 github.com/google/go-cmp v0.5.5 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 + github.com/gorilla/websocket v1.4.2 github.com/hashicorp/go-version v1.2.1 github.com/henvic/httpretty v0.0.6 github.com/itchyny/gojq v0.12.4 @@ -24,8 +26,13 @@ require ( github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d github.com/muesli/reflow v0.2.1-0.20210502190812-c80126ec2ad5 github.com/muesli/termenv v0.8.1 + github.com/muhammadmuzzammil1998/jsonc v0.0.0-20201229145248-615b0916ca38 + github.com/olekukonko/tablewriter v0.0.5 + github.com/opentracing/opentracing-go v1.1.0 github.com/shurcooL/githubv4 v0.0.0-20200928013246-d292edc3691b github.com/shurcooL/graphql v0.0.0-20181231061246-d48a9a75455f + github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 + github.com/sourcegraph/jsonrpc2 v0.1.0 github.com/spf13/cobra v1.2.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/objx v0.1.1 // indirect diff --git a/go.sum b/go.sum index cf3f5b57b..f40e2ef5c 100644 --- a/go.sum +++ b/go.sum @@ -103,6 +103,8 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/camelcase v1.0.0 h1:hxNvNX/xYBp0ovncs8WyWZrOrpBNub/JfaMvbURyft8= +github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -182,6 +184,9 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= +github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/graph-gophers/graphql-go v0.0.0-20200622220639-c1d9693c95a6/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= @@ -273,8 +278,11 @@ github.com/muesli/reflow v0.2.1-0.20210502190812-c80126ec2ad5 h1:T+Fc6qGlSfM+z0J github.com/muesli/reflow v0.2.1-0.20210502190812-c80126ec2ad5/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ= github.com/muesli/termenv v0.8.1 h1:9q230czSP3DHVpkaPDXGp0TOfAwyjyYwXlUCQxQSaBk= github.com/muesli/termenv v0.8.1/go.mod h1:kzt/D/4a88RoheZmwfqorY3A+tnsSMA9HJC/fQSFKo0= +github.com/muhammadmuzzammil1998/jsonc v0.0.0-20201229145248-615b0916ca38 h1:0FrBxrkJ0hVembTb/e4EU5Ml6vLcOusAqymmYISg5Uo= +github.com/muhammadmuzzammil1998/jsonc v0.0.0-20201229145248-615b0916ca38/go.mod h1:saF2fIVw4banK0H4+/EuqfFLpRnoy5S+ECwTOCcRcSU= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= @@ -300,8 +308,12 @@ github.com/shurcooL/githubv4 v0.0.0-20200928013246-d292edc3691b h1:0/ecDXh/HTHRt github.com/shurcooL/githubv4 v0.0.0-20200928013246-d292edc3691b/go.mod h1:hAF0iLZy4td2EX+/8Tw+4nodhlMrwN3HupfaXj3zkGo= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA= +github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/sourcegraph/jsonrpc2 v0.1.0 h1:ohJHjZ+PcaLxDUjqk2NC3tIGsVa5bXThe1ZheSXOjuk= +github.com/sourcegraph/jsonrpc2 v0.1.0/go.mod h1:ZafdZgk/axhT1cvZAPOhw+95nz2I/Ra5qMlU4gTRwIo= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= diff --git a/internal/codespaces/codespaces.go b/internal/codespaces/codespaces.go index f3cf71b51..7f6760560 100644 --- a/internal/codespaces/codespaces.go +++ b/internal/codespaces/codespaces.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - "github.com/github/ghcs/internal/api" - "github.com/github/ghcs/internal/liveshare" + "github.com/cli/cli/v2/internal/api" + "github.com/cli/cli/v2/internal/liveshare" ) type logger interface { diff --git a/internal/codespaces/states.go b/internal/codespaces/states.go index 0b395d6e3..7bd53b5e0 100644 --- a/internal/codespaces/states.go +++ b/internal/codespaces/states.go @@ -9,8 +9,8 @@ import ( "strings" "time" - "github.com/github/ghcs/internal/api" - "github.com/github/ghcs/internal/liveshare" + "github.com/cli/cli/v2/internal/api" + "github.com/cli/cli/v2/internal/liveshare" ) // PostCreateStateStatus is a string value representing the different statuses a state can have. diff --git a/internal/liveshare/client_test.go b/internal/liveshare/client_test.go index 12ea903b6..2bfcfa63f 100644 --- a/internal/liveshare/client_test.go +++ b/internal/liveshare/client_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - livesharetest "github.com/github/ghcs/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/internal/liveshare/test" "github.com/sourcegraph/jsonrpc2" ) diff --git a/internal/liveshare/port_forwarder_test.go b/internal/liveshare/port_forwarder_test.go index 64dfb5c88..eda7262c6 100644 --- a/internal/liveshare/port_forwarder_test.go +++ b/internal/liveshare/port_forwarder_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - livesharetest "github.com/github/ghcs/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/internal/liveshare/test" "github.com/sourcegraph/jsonrpc2" ) diff --git a/internal/liveshare/session_test.go b/internal/liveshare/session_test.go index af41dd117..461b4eb66 100644 --- a/internal/liveshare/session_test.go +++ b/internal/liveshare/session_test.go @@ -9,7 +9,7 @@ import ( "strings" "testing" - livesharetest "github.com/github/ghcs/internal/liveshare/test" + livesharetest "github.com/cli/cli/v2/internal/liveshare/test" "github.com/sourcegraph/jsonrpc2" )