Skip to content

Commit 917ef1b

Browse files
committed
gofmt -s
1 parent 823c4b8 commit 917ef1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2110
-2110
lines changed

helper/resource/map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func (m *Map) Refresh(
124124
// a ResourceProvider.
125125
func (m *Map) Resources() []terraform.ResourceType {
126126
ks := make([]string, 0, len(m.Mapping))
127-
for k, _ := range m.Mapping {
127+
for k := range m.Mapping {
128128
ks = append(ks, k)
129129
}
130130
sort.Strings(ks)

helper/resource/map_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ import (
1111
func TestMapResources(t *testing.T) {
1212
m := &Map{
1313
Mapping: map[string]Resource{
14-
"aws_elb": Resource{},
15-
"aws_instance": Resource{},
14+
"aws_elb": {},
15+
"aws_instance": {},
1616
},
1717
}
1818

1919
rts := m.Resources()
2020

2121
expected := []terraform.ResourceType{
22-
terraform.ResourceType{
22+
{
2323
Name: "aws_elb",
2424
},
25-
terraform.ResourceType{
25+
{
2626
Name: "aws_instance",
2727
},
2828
}
@@ -35,7 +35,7 @@ func TestMapResources(t *testing.T) {
3535
func TestMapValidate(t *testing.T) {
3636
m := &Map{
3737
Mapping: map[string]Resource{
38-
"aws_elb": Resource{
38+
"aws_elb": {
3939
ConfigValidator: &config.Validator{
4040
Required: []string{"foo"},
4141
},

helper/resource/state_shim_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func TestStateShim(t *testing.T) {
177177
expected := &terraform.State{
178178
Version: 3,
179179
Modules: []*terraform.ModuleState{
180-
&terraform.ModuleState{
180+
{
181181
Path: []string{"root"},
182182
Outputs: map[string]*terraform.OutputState{
183183
"bar": {
@@ -191,7 +191,7 @@ func TestStateShim(t *testing.T) {
191191
},
192192
},
193193
Resources: map[string]*terraform.ResourceState{
194-
"test_thing.baz": &terraform.ResourceState{
194+
"test_thing.baz": {
195195
Type: "test_thing",
196196
Provider: "provider.test",
197197
Primary: &terraform.InstanceState{
@@ -202,7 +202,7 @@ func TestStateShim(t *testing.T) {
202202
},
203203
},
204204
},
205-
"test_thing.foo": &terraform.ResourceState{
205+
"test_thing.foo": {
206206
Type: "test_thing",
207207
Provider: "provider.test",
208208
Primary: &terraform.InstanceState{
@@ -219,10 +219,10 @@ func TestStateShim(t *testing.T) {
219219
},
220220
},
221221
},
222-
&terraform.ModuleState{
222+
{
223223
Path: []string{"root", "child"},
224224
Resources: map[string]*terraform.ResourceState{
225-
"test_thing.baz": &terraform.ResourceState{
225+
"test_thing.baz": {
226226
Type: "test_thing",
227227
Provider: "module.child.provider.test",
228228
Primary: &terraform.InstanceState{
@@ -243,7 +243,7 @@ func TestStateShim(t *testing.T) {
243243
},
244244
Dependencies: []string{"data.test_data_thing.foo"},
245245
},
246-
"data.test_data_thing.foo": &terraform.ResourceState{
246+
"data.test_data_thing.foo": {
247247
Type: "test_data_thing",
248248
Provider: "module.child.provider.test",
249249
Primary: &terraform.InstanceState{
@@ -254,7 +254,7 @@ func TestStateShim(t *testing.T) {
254254
},
255255
},
256256
},
257-
"test_thing.lots.0": &terraform.ResourceState{
257+
"test_thing.lots.0": {
258258
Type: "test_thing",
259259
Provider: "module.child.provider.test",
260260
Primary: &terraform.InstanceState{
@@ -265,7 +265,7 @@ func TestStateShim(t *testing.T) {
265265
},
266266
},
267267
},
268-
"test_thing.lots.1": &terraform.ResourceState{
268+
"test_thing.lots.1": {
269269
Type: "test_thing",
270270
Provider: "module.child.provider.test",
271271
Primary: &terraform.InstanceState{
@@ -277,7 +277,7 @@ func TestStateShim(t *testing.T) {
277277
Tainted: true,
278278
},
279279
},
280-
"test_thing.single_count": &terraform.ResourceState{
280+
"test_thing.single_count": {
281281
Type: "test_thing",
282282
Provider: "module.child.provider.test",
283283
Primary: &terraform.InstanceState{
@@ -296,7 +296,7 @@ func TestStateShim(t *testing.T) {
296296
providers := map[string]terraform.ResourceProvider{
297297
"test": &schema.Provider{
298298
ResourcesMap: map[string]*schema.Resource{
299-
"test_thing": &schema.Resource{
299+
"test_thing": {
300300
Schema: map[string]*schema.Schema{
301301
"id": {Type: schema.TypeString, Computed: true},
302302
"fizzle": {Type: schema.TypeString, Optional: true},
@@ -305,7 +305,7 @@ func TestStateShim(t *testing.T) {
305305
},
306306
},
307307
DataSourcesMap: map[string]*schema.Resource{
308-
"test_data_thing": &schema.Resource{
308+
"test_data_thing": {
309309
Schema: map[string]*schema.Schema{
310310
"id": {Type: schema.TypeString, Computed: true},
311311
"fuzzle": {Type: schema.TypeString, Optional: true},

helper/resource/testing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -873,12 +873,12 @@ func testIDOnlyRefresh(c TestCase, opts terraform.ContextOpts, step TestStep, r
873873
expected := r.Primary.Attributes
874874
// Remove fields we're ignoring
875875
for _, v := range c.IDRefreshIgnore {
876-
for k, _ := range actual {
876+
for k := range actual {
877877
if strings.HasPrefix(k, v) {
878878
delete(actual, k)
879879
}
880880
}
881-
for k, _ := range expected {
881+
for k := range expected {
882882
if strings.HasPrefix(k, v) {
883883
delete(expected, k)
884884
}

helper/resource/testing_import_state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func testStepImportState(
8181
Config: cfg,
8282

8383
Targets: []*terraform.ImportTarget{
84-
&terraform.ImportTarget{
84+
{
8585
Addr: importAddr,
8686
ID: importId,
8787
},

helper/resource/testing_import_state_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ func TestTest_importState(t *testing.T) {
1313

1414
mp := testProvider()
1515
mp.ImportStateReturn = []*terraform.InstanceState{
16-
&terraform.InstanceState{
16+
{
1717
ID: "foo",
1818
Ephemeral: terraform.EphemeralState{Type: "test_instance"},
1919
},
@@ -42,7 +42,7 @@ func TestTest_importState(t *testing.T) {
4242
},
4343

4444
Steps: []TestStep{
45-
TestStep{
45+
{
4646
Config: testConfigStrProvider,
4747
ResourceName: "test_instance.foo",
4848
ImportState: true,
@@ -65,7 +65,7 @@ func TestTest_importStateFail(t *testing.T) {
6565

6666
mp := testProvider()
6767
mp.ImportStateReturn = []*terraform.InstanceState{
68-
&terraform.InstanceState{
68+
{
6969
ID: "bar",
7070
Ephemeral: terraform.EphemeralState{Type: "test_instance"},
7171
},
@@ -94,7 +94,7 @@ func TestTest_importStateFail(t *testing.T) {
9494
},
9595

9696
Steps: []TestStep{
97-
TestStep{
97+
{
9898
Config: testConfigStrProvider,
9999
ResourceName: "test_instance.foo",
100100
ImportState: true,
@@ -143,7 +143,7 @@ func TestTest_importStateDetectId(t *testing.T) {
143143
}
144144

145145
return []*terraform.InstanceState{
146-
&terraform.InstanceState{
146+
{
147147
ID: "bar",
148148
Ephemeral: terraform.EphemeralState{Type: "test_instance"},
149149
},
@@ -168,10 +168,10 @@ func TestTest_importStateDetectId(t *testing.T) {
168168
},
169169

170170
Steps: []TestStep{
171-
TestStep{
171+
{
172172
Config: testConfigStr,
173173
},
174-
TestStep{
174+
{
175175
Config: testConfigStr,
176176
ResourceName: "test_instance.foo",
177177
ImportState: true,
@@ -306,7 +306,7 @@ func TestTest_importStateVerify(t *testing.T) {
306306
}
307307

308308
return []*terraform.InstanceState{
309-
&terraform.InstanceState{
309+
{
310310
ID: "foo",
311311
Ephemeral: terraform.EphemeralState{Type: "test_instance"},
312312
},
@@ -320,10 +320,10 @@ func TestTest_importStateVerify(t *testing.T) {
320320
},
321321

322322
Steps: []TestStep{
323-
TestStep{
323+
{
324324
Config: testConfigStr,
325325
},
326-
TestStep{
326+
{
327327
Config: testConfigStr,
328328
ResourceName: "test_instance.foo",
329329
ImportState: true,
@@ -371,7 +371,7 @@ func TestTest_importStateVerifyFail(t *testing.T) {
371371
}
372372

373373
return []*terraform.InstanceState{
374-
&terraform.InstanceState{
374+
{
375375
ID: "foo",
376376
Ephemeral: terraform.EphemeralState{Type: "test_instance"},
377377
},
@@ -385,10 +385,10 @@ func TestTest_importStateVerifyFail(t *testing.T) {
385385
},
386386

387387
Steps: []TestStep{
388-
TestStep{
388+
{
389389
Config: testConfigStr,
390390
},
391-
TestStep{
391+
{
392392
Config: testConfigStr,
393393
ResourceName: "test_instance.foo",
394394
ImportState: true,
@@ -444,7 +444,7 @@ func TestTest_importStateIdFunc(t *testing.T) {
444444
},
445445

446446
Steps: []TestStep{
447-
TestStep{
447+
{
448448
Config: testConfigStrProvider,
449449
ResourceName: "test_instance.foo",
450450
ImportState: true,
@@ -501,7 +501,7 @@ func TestTest_importStateIdFuncFail(t *testing.T) {
501501
},
502502

503503
Steps: []TestStep{
504-
TestStep{
504+
{
505505
Config: testConfigStrProvider,
506506
ResourceName: "test_instance.foo",
507507
ImportState: true,

helper/resource/testing_new.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ func testIDRefresh(c TestCase, t *testing.T, wd *tftest.WorkingDir, step TestSte
146146
expected := r.Primary.Attributes
147147
// Remove fields we're ignoring
148148
for _, v := range c.IDRefreshIgnore {
149-
for k, _ := range actual {
149+
for k := range actual {
150150
if strings.HasPrefix(k, v) {
151151
delete(actual, k)
152152
}
153153
}
154-
for k, _ := range expected {
154+
for k := range expected {
155155
if strings.HasPrefix(k, v) {
156156
delete(expected, k)
157157
}

0 commit comments

Comments
 (0)