diff --git a/api/queries_org.go b/api/queries_org.go index 3f8ee60a6..e1b6a083c 100644 --- a/api/queries_org.go +++ b/api/queries_org.go @@ -2,33 +2,10 @@ package api import ( "context" - "fmt" "github.com/shurcooL/githubv4" ) -// TODO clean up -// using API v3 here because the equivalent in GraphQL needs `read:org` scope -func resolveOrganization(client *Client, orgName string) (string, error) { - var response struct { - NodeID string `json:"node_id"` - } - err := client.REST("GET", fmt.Sprintf("users/%s", orgName), nil, &response) - return response.NodeID, err -} - -// using API v3 here because the equivalent in GraphQL needs `read:org` scope -func resolveOrganizationTeam(client *Client, orgName, teamSlug string) (string, string, error) { - var response struct { - NodeID string `json:"node_id"` - Organization struct { - NodeID string `json:"node_id"` - } - } - err := client.REST("GET", fmt.Sprintf("orgs/%s/teams/%s", orgName, teamSlug), nil, &response) - return response.Organization.NodeID, response.NodeID, err -} - // OrganizationProjects fetches all open projects for an organization func OrganizationProjects(client *Client, owner string) ([]RepoProject, error) { var query struct { diff --git a/pkg/cmd/repo/clone/clone_test.go b/pkg/cmd/repo/clone/clone_test.go index 670573a87..c732c8bfe 100644 --- a/pkg/cmd/repo/clone/clone_test.go +++ b/pkg/cmd/repo/clone/clone_test.go @@ -45,7 +45,7 @@ func runCloneCommand(httpClient *http.Client, cli string) (*test.CmdOut, error) return nil, err } - return &test.CmdOut{stdout, stderr}, nil + return &test.CmdOut{OutBuf: stdout, ErrBuf: stderr}, nil } func Test_RepoClone(t *testing.T) { diff --git a/pkg/cmd/repo/create/create_test.go b/pkg/cmd/repo/create/create_test.go index 8bca0c6a9..674f28437 100644 --- a/pkg/cmd/repo/create/create_test.go +++ b/pkg/cmd/repo/create/create_test.go @@ -59,7 +59,9 @@ func runCommand(httpClient *http.Client, cli string) (*test.CmdOut, error) { return nil, err } - return &test.CmdOut{stdout, stderr}, nil + return &test.CmdOut{ + OutBuf: stdout, + ErrBuf: stderr}, nil } func TestRepoCreate(t *testing.T) {