Merge remote-tracking branch 'origin' into go-1.19-upgrade
This commit is contained in:
commit
d273005f40
4 changed files with 7 additions and 22 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue