Skip to content

Commit 7963e72

Browse files
authored
Merge pull request #353 from hashicorp/tfplugin5.2-v1
Update to tfplugin 5.2, map new protocol fields (v1)
2 parents d3b1ac9 + 46f5c10 commit 7963e72

File tree

73 files changed

+2559
-2285
lines changed

Some content is hidden

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

73 files changed

+2559
-2285
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ generate:
1717
protobuf:
1818
bash scripts/protobuf-check.sh
1919
bash internal/tfplugin5/generate.sh
20-
bash internal/plans/internal/planproto/generate.sh
2120

2221
fmt:
2322
gofmt -w $(GOFMT_FILES)

go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/davecgh/go-spew v1.1.1
1313
github.com/go-test/deep v1.0.3
1414
github.com/golang/mock v1.3.1
15-
github.com/golang/protobuf v1.3.2
15+
github.com/golang/protobuf v1.3.4
1616
github.com/golang/snappy v0.0.1
1717
github.com/google/go-cmp v0.3.1
1818
github.com/google/uuid v1.1.1
@@ -47,8 +47,9 @@ require (
4747
github.com/zclconf/go-cty v1.2.1
4848
github.com/zclconf/go-cty-yaml v1.0.1
4949
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586
50-
golang.org/x/net v0.0.0-20191009170851-d66e71096ffb
51-
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa // indirect
50+
golang.org/x/net v0.0.0-20200301022130-244492dfa37a
51+
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 // indirect
5252
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0
53-
google.golang.org/grpc v1.23.0
53+
google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a // indirect
54+
google.golang.org/grpc v1.27.1
5455
)

go.sum

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1U
3232
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4=
3333
github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=
3434
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
35+
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
3536
github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
3637
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
3738
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
3839
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
3940
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
41+
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
42+
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
4043
github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys=
4144
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
4245
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
@@ -52,6 +55,9 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
5255
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
5356
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
5457
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
58+
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
59+
github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
60+
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
5561
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
5662
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
5763
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
@@ -165,6 +171,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
165171
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
166172
github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI=
167173
github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E=
174+
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
168175
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
169176
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
170177
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
@@ -218,8 +225,9 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn
218225
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
219226
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
220227
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
221-
golang.org/x/net v0.0.0-20191009170851-d66e71096ffb h1:TR699M2v0qoKTOHxeLgp6zPqaQNs74f01a/ob9W0qko=
222228
golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
229+
golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0=
230+
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
223231
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
224232
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
225233
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
@@ -242,8 +250,8 @@ golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7w
242250
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
243251
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0 h1:HyfiK1WMnHj5FXFXatD+Qs1A/xC2Run6RzeW1SyHxpc=
244252
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
245-
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M=
246-
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
253+
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So=
254+
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
247255
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
248256
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
249257
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
@@ -281,12 +289,17 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn
281289
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
282290
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE=
283291
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
292+
google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a h1:lRlI5zu6AFy3iU/F8YWyNrAmn/tPCnhiTxfwhWb76eU=
293+
google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
284294
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
285295
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
286296
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
287297
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
288298
google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A=
289299
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
300+
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
301+
google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk=
302+
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
290303
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
291304
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
292305
gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=

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)