From 8ffd0d59f618663d6a98ef2f7563a29a1a866cc0 Mon Sep 17 00:00:00 2001 From: gedenata Date: Fri, 12 Jun 2020 04:23:51 +0800 Subject: [PATCH] redundant type composite literal --- context/remote_test.go | 8 ++++---- git/git_test.go | 6 +++--- git/ssh_config_test.go | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/context/remote_test.go b/context/remote_test.go index 9cf7a0adf..1e0f47ba0 100644 --- a/context/remote_test.go +++ b/context/remote_test.go @@ -95,12 +95,12 @@ func Test_resolvedRemotes_triangularSetup(t *testing.T) { }, Network: api.RepoNetworkResult{ Repositories: []*api.Repository{ - &api.Repository{ + { Name: "NEWNAME", Owner: api.RepositoryOwner{Login: "NEWOWNER"}, ViewerPermission: "READ", }, - &api.Repository{ + { Name: "REPO", Owner: api.RepositoryOwner{Login: "MYSELF"}, ViewerPermission: "ADMIN", @@ -163,7 +163,7 @@ func Test_resolvedRemotes_forkLookup(t *testing.T) { }, Network: api.RepoNetworkResult{ Repositories: []*api.Repository{ - &api.Repository{ + { Name: "NEWNAME", Owner: api.RepositoryOwner{Login: "NEWOWNER"}, ViewerPermission: "READ", @@ -196,7 +196,7 @@ func Test_resolvedRemotes_clonedFork(t *testing.T) { }, Network: api.RepoNetworkResult{ Repositories: []*api.Repository{ - &api.Repository{ + { Name: "REPO", Owner: api.RepositoryOwner{Login: "OWNER"}, ViewerPermission: "ADMIN", diff --git a/git/git_test.go b/git/git_test.go index c84023e40..8cd97a10d 100644 --- a/git/git_test.go +++ b/git/git_test.go @@ -15,9 +15,9 @@ func Test_UncommittedChangeCount(t *testing.T) { Output string } cases := []c{ - c{Label: "no changes", Expected: 0, Output: ""}, - c{Label: "one change", Expected: 1, Output: " M poem.txt"}, - c{Label: "untracked file", Expected: 2, Output: " M poem.txt\n?? new.txt"}, + {Label: "no changes", Expected: 0, Output: ""}, + {Label: "one change", Expected: 1, Output: " M poem.txt"}, + {Label: "untracked file", Expected: 2, Output: " M poem.txt\n?? new.txt"}, } teardown := run.SetPrepareCmd(func(*exec.Cmd) run.Runnable { diff --git a/git/ssh_config_test.go b/git/ssh_config_test.go index 35a0c93e6..28f339aa6 100644 --- a/git/ssh_config_test.go +++ b/git/ssh_config_test.go @@ -36,9 +36,9 @@ func Test_Translator(t *testing.T) { tr := m.Translator() cases := [][]string{ - []string{"ssh://gh/o/r", "ssh://github.com/o/r"}, - []string{"ssh://github.com/o/r", "ssh://github.com/o/r"}, - []string{"https://gh/o/r", "https://gh/o/r"}, + {"ssh://gh/o/r", "ssh://github.com/o/r"}, + {"ssh://github.com/o/r", "ssh://github.com/o/r"}, + {"https://gh/o/r", "https://gh/o/r"}, } for _, c := range cases { u, _ := url.Parse(c[0])