Skip to content

Commit 646549c

Browse files
authored
Merge pull request #75 from jennybuckley/gofmt
Run gofmt
2 parents 18dcdd8 + a0c9bd9 commit 646549c

File tree

7 files changed

+34
-35
lines changed

7 files changed

+34
-35
lines changed

internal/fixture/state.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (s *State) Update(obj typed.YAMLObject, version fieldpath.APIVersion, manag
8888
return err
8989
}
9090
tv, err := s.Parser.FromYAML(obj)
91-
s.Live , err = s.Updater.Converter.Convert(s.Live, version)
91+
s.Live, err = s.Updater.Converter.Convert(s.Live, version)
9292
if err != nil {
9393
return err
9494
}
@@ -112,7 +112,7 @@ func (s *State) Apply(obj typed.YAMLObject, version fieldpath.APIVersion, manage
112112
if err != nil {
113113
return err
114114
}
115-
s.Live , err = s.Updater.Converter.Convert(s.Live, version)
115+
s.Live, err = s.Updater.Converter.Convert(s.Live, version)
116116
if err != nil {
117117
return err
118118
}

merge/key_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
/*
22
Copyright 2019 The Kubernetes Authors.
3-
3+
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
7-
7+
88
http://www.apache.org/licenses/LICENSE-2.0
9-
9+
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
1717
package merge_test
18-
18+
1919
import (
2020
"testing"
21-
21+
2222
"sigs.k8s.io/structured-merge-diff/fieldpath"
2323
. "sigs.k8s.io/structured-merge-diff/internal/fixture"
2424
"sigs.k8s.io/structured-merge-diff/typed"
2525
)
26-
26+
2727
var associativeListParser = func() typed.ParseableType {
2828
parser, err := typed.NewParser(`types:
2929
- name: type
@@ -54,7 +54,7 @@ var associativeListParser = func() typed.ParseableType {
5454
}
5555
return parser.Type("type")
5656
}()
57-
57+
5858
func TestUpdateAssociativeLists(t *testing.T) {
5959
tests := map[string]TestCase{
6060
"removing_obsolete_applied_structs": {
@@ -95,7 +95,7 @@ func TestUpdateAssociativeLists(t *testing.T) {
9595
},
9696
},
9797
}
98-
98+
9999
for name, test := range tests {
100100
t.Run(name, func(t *testing.T) {
101101
if err := test.Test(associativeListParser); err != nil {

merge/multiple_appliers_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ func TestMultipleAppliersRealConversion(t *testing.T) {
825825
}
826826

827827
// repeatingConverter repeats a single letterkey v times, where v is the version.
828-
type repeatingConverter struct{
828+
type repeatingConverter struct {
829829
typed.ParseableType
830830
}
831831

@@ -856,7 +856,7 @@ func (r repeatingConverter) Convert(v *typed.TypedValue, version fieldpath.APIVe
856856
if len(spaces) == 0 {
857857
break
858858
}
859-
c := line[len(spaces):len(spaces)+1]
859+
c := line[len(spaces) : len(spaces)+1]
860860
c = strings.Repeat(c, versionNumber)
861861
str2 = fmt.Sprintf("%v\n%v%v:", str2, spaces, c)
862862
}
@@ -869,15 +869,15 @@ func (r repeatingConverter) Convert(v *typed.TypedValue, version fieldpath.APIVe
869869
}
870870

871871
func countLeadingSpace(line string) int {
872-
spaces := 0
873-
for _, letter := range line {
874-
if letter == ' ' {
875-
spaces++
876-
} else {
877-
break
878-
}
879-
}
880-
return spaces
872+
spaces := 0
873+
for _, letter := range line {
874+
if letter == ' ' {
875+
spaces++
876+
} else {
877+
break
878+
}
879+
}
880+
return spaces
881881
}
882882

883883
// Convert implements merge.Converter

merge/nested_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
/*
22
Copyright 2019 The Kubernetes Authors.
3-
3+
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
66
You may obtain a copy of the License at
7-
7+
88
http://www.apache.org/licenses/LICENSE-2.0
9-
9+
1010
Unless required by applicable law or agreed to in writing, software
1111
distributed under the License is distributed on an "AS IS" BASIS,
1212
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
16+
1717
package merge_test
18-
18+
1919
import (
2020
"testing"
21-
21+
2222
"sigs.k8s.io/structured-merge-diff/fieldpath"
2323
. "sigs.k8s.io/structured-merge-diff/internal/fixture"
2424
"sigs.k8s.io/structured-merge-diff/typed"
2525
)
26-
26+
2727
var nestedTypeParser = func() typed.ParseableType {
2828
parser, err := typed.NewParser(`types:
2929
- name: type
@@ -103,7 +103,7 @@ var nestedTypeParser = func() typed.ParseableType {
103103
}
104104
return parser.Type("type")
105105
}()
106-
106+
107107
func TestUpdateNestedType(t *testing.T) {
108108
tests := map[string]TestCase{
109109
"listOfLists_change_value": {
@@ -483,7 +483,7 @@ func TestUpdateNestedType(t *testing.T) {
483483
},
484484
},
485485
}
486-
486+
487487
for name, test := range tests {
488488
t.Run(name, func(t *testing.T) {
489489
if err := test.Test(nestedTypeParser); err != nil {

merge/update.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ func (s *Updater) addBackOwnedItems(merged, pruned *typed.TypedValue, managedFie
249249
return pruned, nil
250250
}
251251

252-
253252
// addBackDanglingItems makes sure that the only items removed by prune are items that were
254253
// previously owned by the currently applying manager. This will add back unowned items and items
255254
// which are owned by Updaters that shouldn't be removed.

typed/merge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func (w *mergingWalker) doUntyped(t schema.Untyped) (errs ValidationErrors) {
405405
}
406406
if t.ElementRelationship == schema.Deduced {
407407
// Merge using the lhs's type on a shallow copy of the merge walker,
408-
// to get rid of the merged output
408+
// to get rid of the merged output
409409
w2 := *w
410410
w2.typeRef = schema.DeduceType(w.lhs)
411411
w2.merge()

typed/toset_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ var fieldsetCases = []fieldsetTestCase{{
166166
{`{"arbitraryWavelengthColor":{"IR":255}}`, _NS(_P("arbitraryWavelengthColor"))},
167167
{`{"args":[]}`, _NS(_P("args"))},
168168
{`{"args":null}`, _NS(_P("args"))},
169-
{`{"args":[null]}`,_NS(_P("args"))},
170-
{`{"args":[{"key":"a","value":"b"},{"key":"c","value":"d"}]}`,_NS(_P("args"))},
169+
{`{"args":[null]}`, _NS(_P("args"))},
170+
{`{"args":[{"key":"a","value":"b"},{"key":"c","value":"d"}]}`, _NS(_P("args"))},
171171
},
172172
}, {
173173
name: "associative list",

0 commit comments

Comments
 (0)