linter appeasement

This commit is contained in:
vilmibm 2020-07-24 12:29:06 -05:00
parent c34054bdc8
commit 551c3661cb
3 changed files with 4 additions and 25 deletions

View file

@ -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 {

View file

@ -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) {

View file

@ -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) {