Skip to content

Commit d6b85b6

Browse files
committed
fix gofmt
Signed-off-by: Stephanie <[email protected]>
1 parent eede91d commit d6b85b6

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

pkg/validation/projects.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func ValidateProjects(projects []v1alpha2.Project) error {
6363
errString += fmt.Sprintf("\nproject %s has more than one remote defined, but has no checkoutfrom remote defined", project.Name)
6464
continue
6565
}
66-
err := validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, project.Name)
66+
err := validateRemoteMap(gitSource.Remotes, gitSource.CheckoutFrom.Remote, project.Name)
6767
if err != nil {
6868
errString += fmt.Sprintf("\n%s", err.Error())
6969
}

pkg/validation/projects_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func generateDummyGitStarterProject(name string, checkoutRemote *v1alpha2.Checko
1313
ProjectSource: v1alpha2.ProjectSource{
1414
Git: &v1alpha2.GitProjectSource{
1515
GitLikeProjectSource: v1alpha2.GitLikeProjectSource{
16-
Remotes: remotes,
16+
Remotes: remotes,
1717
CheckoutFrom: checkoutRemote,
1818
},
1919
},
@@ -27,7 +27,7 @@ func generateDummyGithubStarterProject(name string, checkoutRemote *v1alpha2.Che
2727
ProjectSource: v1alpha2.ProjectSource{
2828
Github: &v1alpha2.GithubProjectSource{
2929
GitLikeProjectSource: v1alpha2.GitLikeProjectSource{
30-
Remotes: remotes,
30+
Remotes: remotes,
3131
CheckoutFrom: checkoutRemote,
3232
},
3333
},
@@ -41,7 +41,7 @@ func generateDummyGitProject(name string, checkoutRemote *v1alpha2.CheckoutFrom,
4141
ProjectSource: v1alpha2.ProjectSource{
4242
Git: &v1alpha2.GitProjectSource{
4343
GitLikeProjectSource: v1alpha2.GitLikeProjectSource{
44-
Remotes: remotes,
44+
Remotes: remotes,
4545
CheckoutFrom: checkoutRemote,
4646
},
4747
},
@@ -55,7 +55,7 @@ func generateDummyGithubProject(name string, checkoutRemote *v1alpha2.CheckoutFr
5555
ProjectSource: v1alpha2.ProjectSource{
5656
Github: &v1alpha2.GithubProjectSource{
5757
GitLikeProjectSource: v1alpha2.GitLikeProjectSource{
58-
Remotes: remotes,
58+
Remotes: remotes,
5959
CheckoutFrom: checkoutRemote,
6060
},
6161
},
@@ -110,8 +110,8 @@ func TestValidateStarterProjects(t *testing.T) {
110110
{
111111
name: "Invalid Starter Project with empty remotes",
112112
starterProjects: []v1alpha2.StarterProject{
113-
generateDummyGithubStarterProject("project1", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{}),
114-
generateDummyGithubStarterProject("project3", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{"origin": "originremote", "test": "testremote"}),
113+
generateDummyGithubStarterProject("project1", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{}),
114+
generateDummyGithubStarterProject("project3", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{"origin": "originremote", "test": "testremote"}),
115115
},
116116
wantErr: &atleastOneRemoteErr,
117117
},
@@ -143,44 +143,44 @@ func TestValidateProjects(t *testing.T) {
143143
{
144144
name: "Valid Project",
145145
projects: []v1alpha2.Project{
146-
generateDummyGitProject("project1", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{"origin": "originremote"}),
147-
generateDummyGithubProject("project2", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{"origin": "originremote"}),
146+
generateDummyGitProject("project1", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{"origin": "originremote"}),
147+
generateDummyGithubProject("project2", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{"origin": "originremote"}),
148148
},
149149
},
150150
{
151151
name: "Invalid Project with multiple remotes but no checkoutfrom",
152152
projects: []v1alpha2.Project{
153-
generateDummyGithubProject("project2",nil, map[string]string{"origin": "originremote", "test": "testremote"}),
153+
generateDummyGithubProject("project2", nil, map[string]string{"origin": "originremote", "test": "testremote"}),
154154
},
155155
wantErr: &missingCheckOutFromRemoteErr,
156156
},
157157
{
158158
name: "Invalid Project with multiple remote and empty checkout remote",
159159
projects: []v1alpha2.Project{
160-
generateDummyGitProject("project2", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{"origin": "originremote"}),
161-
generateDummyGithubProject("project1", &v1alpha2.CheckoutFrom{Remote: ""}, map[string]string{"origin": "originremote", "test": "testremote"}),
160+
generateDummyGitProject("project2", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{"origin": "originremote"}),
161+
generateDummyGithubProject("project1", &v1alpha2.CheckoutFrom{Remote: ""}, map[string]string{"origin": "originremote", "test": "testremote"}),
162162
},
163163
wantErr: &missingCheckOutFromRemoteErr,
164164
},
165165
{
166166
name: "Invalid Project with wrong checkout",
167167
projects: []v1alpha2.Project{
168-
generateDummyGithubProject("project1", &v1alpha2.CheckoutFrom{Remote: "origin1"}, map[string]string{"origin": "originremote", "test": "testremote"}),
169-
generateDummyGitProject("project2", &v1alpha2.CheckoutFrom{Remote: "origin1"}, map[string]string{"origin2": "originremote2"}),
168+
generateDummyGithubProject("project1", &v1alpha2.CheckoutFrom{Remote: "origin1"}, map[string]string{"origin": "originremote", "test": "testremote"}),
169+
generateDummyGitProject("project2", &v1alpha2.CheckoutFrom{Remote: "origin1"}, map[string]string{"origin2": "originremote2"}),
170170
},
171171
wantErr: &wrongCheckoutErr,
172172
},
173173
{
174174
name: "Valid Project with empty checkout remote",
175175
projects: []v1alpha2.Project{
176-
generateDummyGitProject("project1", &v1alpha2.CheckoutFrom{Remote: ""}, map[string]string{"origin": "originremote"}),
176+
generateDummyGitProject("project1", &v1alpha2.CheckoutFrom{Remote: ""}, map[string]string{"origin": "originremote"}),
177177
},
178178
},
179179
{
180180
name: "Invalid Project with empty remotes",
181181
projects: []v1alpha2.Project{
182-
generateDummyGitProject("project1", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{}),
183-
generateDummyGithubProject("project2", &v1alpha2.CheckoutFrom{Remote: "origins"}, map[string]string{"origin": "originremote", "test": "testremote"}),
182+
generateDummyGitProject("project1", &v1alpha2.CheckoutFrom{Remote: "origin"}, map[string]string{}),
183+
generateDummyGithubProject("project2", &v1alpha2.CheckoutFrom{Remote: "origins"}, map[string]string{"origin": "originremote", "test": "testremote"}),
184184
},
185185
wantErr: &atleastOneRemoteErr,
186186
},

0 commit comments

Comments
 (0)