diff --git a/internal/config/config.go b/internal/config/config.go index 1afbbf0a0..8fbd9e758 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -14,6 +14,7 @@ const ( ) // This interface describes interacting with some persistent configuration for gh. +// //go:generate moq -rm -out config_mock.go . Config type Config interface { AuthToken(string) (string, string) diff --git a/pkg/cmd/codespace/select.go b/pkg/cmd/codespace/select.go index d95162c12..32cc277b2 100644 --- a/pkg/cmd/codespace/select.go +++ b/pkg/cmd/codespace/select.go @@ -29,24 +29,9 @@ func newSelectCmd(app *App) *cobra.Command { return selectCmd } -// Hidden codespace `select` command allows to reuse existing codespace selection -// dialog by external GH CLI extensions. By default output selected codespace name -// into `stdout`. Pass `--file`(`-f`) flag along with a file path to output selected -// codespace name into a file instead. -// -// ## Examples -// -// With `stdout` output: -// -// ```shell -// gh codespace select -// ``` -// -// With `into-a-file` output: -// -// ```shell -// gh codespace select --file /tmp/selected_codespace.txt -// ``` +// Hidden codespace select command allows to reuse existing codespace selection +// dialog by external GH CLI extensions. By default, print selected codespace name +// to stdout. Pass file argument to save result into a file instead. func (a *App) Select(ctx context.Context, name string, opts selectOptions) (err error) { codespace, err := getOrChooseCodespace(ctx, a.apiClient, name) if err != nil { diff --git a/pkg/cmd/codespace/ssh_test.go b/pkg/cmd/codespace/ssh_test.go index 3f6cdfae3..2c59539da 100644 --- a/pkg/cmd/codespace/ssh_test.go +++ b/pkg/cmd/codespace/ssh_test.go @@ -3,7 +3,6 @@ package codespace import ( "context" "fmt" - "io/ioutil" "os" "path/filepath" "strings" @@ -103,7 +102,7 @@ func TestGenerateAutomaticSSHKeys(t *testing.T) { } // Check that no unexpected files are present - allExistingFiles, err := ioutil.ReadDir(dir) + allExistingFiles, err := os.ReadDir(dir) if err != nil { t.Errorf("Failed to list files in test directory: %v", err) } diff --git a/pkg/cmd/status/status_test.go b/pkg/cmd/status/status_test.go index 73ca3d5ff..c592c90a0 100644 --- a/pkg/cmd/status/status_test.go +++ b/pkg/cmd/status/status_test.go @@ -2,7 +2,7 @@ package status import ( "bytes" - "io/ioutil" + "io" "net/http" "strings" "testing" @@ -247,7 +247,7 @@ func TestStatusRun(t *testing.T) { return &http.Response{ Request: req, StatusCode: 403, - Body: ioutil.NopCloser(strings.NewReader(`{"message": "You don't have permission to access this resource."}`)), + Body: io.NopCloser(strings.NewReader(`{"message": "You don't have permission to access this resource."}`)), Header: http.Header{ "Content-Type": []string{"application/json"}, "X-Github-Sso": []string{"required; url=http://click.me/auth"},