X Tutup
Skip to content

Commit 54e0534

Browse files
author
Nate Smith
authored
Merge pull request cli#1177 from cli/simplifycompositelit
Remove redundant type declarations for composite struct literals
2 parents d3aa122 + ba9370a commit 54e0534

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
linters:
2+
enable:
3+
gofmt

context/remote_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ func Test_resolvedRemotes_triangularSetup(t *testing.T) {
9595
},
9696
Network: api.RepoNetworkResult{
9797
Repositories: []*api.Repository{
98-
&api.Repository{
98+
{
9999
Name: "NEWNAME",
100100
Owner: api.RepositoryOwner{Login: "NEWOWNER"},
101101
ViewerPermission: "READ",
102102
},
103-
&api.Repository{
103+
{
104104
Name: "REPO",
105105
Owner: api.RepositoryOwner{Login: "MYSELF"},
106106
ViewerPermission: "ADMIN",
@@ -163,7 +163,7 @@ func Test_resolvedRemotes_forkLookup(t *testing.T) {
163163
},
164164
Network: api.RepoNetworkResult{
165165
Repositories: []*api.Repository{
166-
&api.Repository{
166+
{
167167
Name: "NEWNAME",
168168
Owner: api.RepositoryOwner{Login: "NEWOWNER"},
169169
ViewerPermission: "READ",
@@ -196,7 +196,7 @@ func Test_resolvedRemotes_clonedFork(t *testing.T) {
196196
},
197197
Network: api.RepoNetworkResult{
198198
Repositories: []*api.Repository{
199-
&api.Repository{
199+
{
200200
Name: "REPO",
201201
Owner: api.RepositoryOwner{Login: "OWNER"},
202202
ViewerPermission: "ADMIN",

git/git_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ func Test_UncommittedChangeCount(t *testing.T) {
1515
Output string
1616
}
1717
cases := []c{
18-
c{Label: "no changes", Expected: 0, Output: ""},
19-
c{Label: "one change", Expected: 1, Output: " M poem.txt"},
20-
c{Label: "untracked file", Expected: 2, Output: " M poem.txt\n?? new.txt"},
18+
{Label: "no changes", Expected: 0, Output: ""},
19+
{Label: "one change", Expected: 1, Output: " M poem.txt"},
20+
{Label: "untracked file", Expected: 2, Output: " M poem.txt\n?? new.txt"},
2121
}
2222

2323
teardown := run.SetPrepareCmd(func(*exec.Cmd) run.Runnable {

git/ssh_config_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ func Test_Translator(t *testing.T) {
3636
tr := m.Translator()
3737

3838
cases := [][]string{
39-
[]string{"ssh://gh/o/r", "ssh://github.com/o/r"},
40-
[]string{"ssh://github.com/o/r", "ssh://github.com/o/r"},
41-
[]string{"https://gh/o/r", "https://gh/o/r"},
39+
{"ssh://gh/o/r", "ssh://github.com/o/r"},
40+
{"ssh://github.com/o/r", "ssh://github.com/o/r"},
41+
{"https://gh/o/r", "https://gh/o/r"},
4242
}
4343
for _, c := range cases {
4444
u, _ := url.Parse(c[0])

0 commit comments

Comments
 (0)
X Tutup