Skip to content

Commit fafebae

Browse files
author
stein
committed
Run go fmt
1 parent 091f6bc commit fafebae

File tree

6 files changed

+30
-28
lines changed

6 files changed

+30
-28
lines changed

cloner/cloner_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package cloner
22

33
import (
4-
"testing"
5-
"github.com/stretchr/testify/assert"
64
"github.com/steinfletcher/github-org-clone/github"
5+
"github.com/stretchr/testify/assert"
6+
"testing"
77
)
88

99
func TestGetTeamId(t *testing.T) {
1010
teams := []github.Team{
11-
{Name:"team1", Id:1},
12-
{Name:"team2", Id:51},
13-
{Name:"team3", Id:101},
11+
{Name: "team1", Id: 1},
12+
{Name: "team2", Id: 51},
13+
{Name: "team3", Id: 101},
1414
}
1515

1616
_, id := teamId(teams, "team3")
@@ -20,7 +20,7 @@ func TestGetTeamId(t *testing.T) {
2020

2121
func TestGetTeamIdErrorsIfNotFound(t *testing.T) {
2222
teams := []github.Team{
23-
{Name:"team1", Id:1},
23+
{Name: "team1", Id: 1},
2424
}
2525

2626
err, _ := teamId(teams, "team3")

github/github.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package github
22

33
import (
4-
"net/http"
4+
"encoding/json"
5+
"errors"
56
"fmt"
67
"io/ioutil"
7-
"time"
8-
"encoding/json"
8+
"net/http"
99
"strings"
10-
"errors"
10+
"time"
1111
)
1212

1313
func NewGithub(username string, apiToken string) Github {

github/github_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package github
22

33
import (
4-
"testing"
54
"github.com/stretchr/testify/assert"
65
"gopkg.in/h2non/gock.v1"
6+
"testing"
77
)
88

99
func TestFetchTeams(t *testing.T) {
@@ -52,4 +52,4 @@ func teamReposResp(page string, linkHeader string, file string) {
5252
Reply(200).
5353
SetHeader("Link", linkHeader).
5454
File("../testdata/" + file)
55-
}
55+
}

main.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package main
22

33
import (
4-
"os"
5-
"github.com/urfave/cli"
4+
"fmt"
5+
"github.com/steinfletcher/github-org-clone/cloner"
66
"github.com/steinfletcher/github-org-clone/github"
77
"github.com/steinfletcher/github-org-clone/shell"
8-
"github.com/steinfletcher/github-org-clone/cloner"
8+
"github.com/urfave/cli"
99
"log"
10-
"fmt"
10+
"os"
1111
"time"
1212
)
1313

@@ -28,30 +28,30 @@ func main() {
2828
app.Description = "A simple cli to clone all the repos managed by a github team"
2929
app.Metadata = map[string]interface{}{
3030
"commit": commit,
31-
"date": date,
31+
"date": date,
3232
}
3333

34-
app.Flags = []cli.Flag {
34+
app.Flags = []cli.Flag{
3535
cli.StringFlag{
36-
Name: "org, o",
36+
Name: "org, o",
3737
Usage: "github organisation",
3838
},
3939
cli.StringFlag{
40-
Name: "team, t",
40+
Name: "team, t",
4141
Usage: "github team",
4242
},
4343
cli.StringFlag{
44-
Name: "username, u",
45-
Usage: "github username",
44+
Name: "username, u",
45+
Usage: "github username",
4646
EnvVar: "GITHUB_USER,GITHUB_USERNAME",
4747
},
4848
cli.StringFlag{
49-
Name: "token, k",
50-
Usage: "github personal access token",
49+
Name: "token, k",
50+
Usage: "github personal access token",
5151
EnvVar: "GITHUB_TOKEN,GITHUB_API_KEY,GITHUB_PERSONAL_ACCESS_TOKEN",
5252
},
5353
cli.StringFlag{
54-
Name: "dir, d",
54+
Name: "dir, d",
5555
Usage: "directory to clone into. Defaults to the org name or org/team name if defined",
5656
},
5757
}

makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ build:
88

99
install:
1010
go install
11+
12+
all: test build install

shell/shell.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package shell
22

33
import (
4-
"os/exec"
54
"fmt"
5+
"os/exec"
66
)
77

88
type Shell interface {
99
Exec(cmd string, args []string) error
1010
}
1111

12-
type shell struct {}
12+
type shell struct{}
1313

1414
func NewShell() Shell {
1515
return &shell{}
@@ -24,4 +24,4 @@ func (s *shell) Exec(cmd string, args []string) error {
2424
fmt.Printf("%s", out)
2525
}
2626
return nil
27-
}
27+
}

0 commit comments

Comments
 (0)