diff --git a/command/apply_destroy_test.go b/command/apply_destroy_test.go index ecbbe37d4..ea34db70d 100644 --- a/command/apply_destroy_test.go +++ b/command/apply_destroy_test.go @@ -227,7 +227,7 @@ func TestApply_destroyTargeted(t *testing.T) { }, }, } - p.PlanResourceChangeFn = func (req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse { + p.PlanResourceChangeFn = func(req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse { return providers.PlanResourceChangeResponse{ PlannedState: req.ProposedNewState, } diff --git a/command/apply_test.go b/command/apply_test.go index ce442806e..8195de61c 100644 --- a/command/apply_test.go +++ b/command/apply_test.go @@ -182,15 +182,15 @@ func TestApply_parallelism(t *testing.T) { provider := &terraform.MockProvider{} provider.GetSchemaReturn = &terraform.ProviderSchema{ ResourceTypes: map[string]*configschema.Block{ - name+"_instance": {}, + name + "_instance": {}, }, } - provider.PlanResourceChangeFn = func (req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse { + provider.PlanResourceChangeFn = func(req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse { return providers.PlanResourceChangeResponse{ PlannedState: req.ProposedNewState, } } - provider.ApplyResourceChangeFn = func (req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { + provider.ApplyResourceChangeFn = func(req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { // Increment so we're counting parallelism started <- 1 runCount.Inc() @@ -1111,7 +1111,7 @@ func TestApply_vars(t *testing.T) { }, }, } - p.ApplyResourceChangeFn = func (req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { + p.ApplyResourceChangeFn = func(req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { return providers.ApplyResourceChangeResponse{ NewState: req.PlannedState, } @@ -1170,7 +1170,7 @@ func TestApply_varFile(t *testing.T) { }, }, } - p.ApplyResourceChangeFn = func (req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { + p.ApplyResourceChangeFn = func(req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { return providers.ApplyResourceChangeResponse{ NewState: req.PlannedState, } @@ -1239,7 +1239,7 @@ func TestApply_varFileDefault(t *testing.T) { }, }, } - p.ApplyResourceChangeFn = func (req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { + p.ApplyResourceChangeFn = func(req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { return providers.ApplyResourceChangeResponse{ NewState: req.PlannedState, } @@ -1307,7 +1307,7 @@ func TestApply_varFileDefaultJSON(t *testing.T) { }, }, } - p.ApplyResourceChangeFn = func (req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { + p.ApplyResourceChangeFn = func(req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { return providers.ApplyResourceChangeResponse{ NewState: req.PlannedState, } @@ -1400,7 +1400,7 @@ func TestApply_backup(t *testing.T) { if !cmp.Equal(actual, expected) { t.Fatalf( "wrong aws_instance.foo state\n%s", - cmp.Diff(expected, actual, cmp.Transformer("bytesAsString", func (b []byte) string { + cmp.Diff(expected, actual, cmp.Transformer("bytesAsString", func(b []byte) string { return string(b) })), ) @@ -1449,7 +1449,7 @@ func TestApply_disableBackup(t *testing.T) { actual = p.ApplyResourceChangeRequest.PriorState expected = cty.ObjectVal(map[string]cty.Value{ - "id": cty.StringVal("bar"), + "id": cty.StringVal("bar"), "ami": cty.NullVal(cty.String), }) if !expected.RawEquals(actual) { @@ -1599,7 +1599,7 @@ func applyFixtureSchema() *terraform.ProviderSchema { ResourceTypes: map[string]*configschema.Block{ "test_instance": { Attributes: map[string]*configschema.Attribute{ - "id": {Type: cty.String, Optional: true, Computed: true}, + "id": {Type: cty.String, Optional: true, Computed: true}, "ami": {Type: cty.String, Optional: true}, }, }, @@ -1615,12 +1615,12 @@ func applyFixtureSchema() *terraform.ProviderSchema { func applyFixtureProvider() *terraform.MockProvider { p := testProvider() p.GetSchemaReturn = applyFixtureSchema() - p.PlanResourceChangeFn = func (req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse { + p.PlanResourceChangeFn = func(req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse { return providers.PlanResourceChangeResponse{ PlannedState: req.ProposedNewState, } } - p.ApplyResourceChangeFn = func (req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { + p.ApplyResourceChangeFn = func(req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { return providers.ApplyResourceChangeResponse{ NewState: cty.UnknownAsNull(req.PlannedState), } diff --git a/command/hook_ui.go b/command/hook_ui.go index f105930d7..c56c886e2 100644 --- a/command/hook_ui.go +++ b/command/hook_ui.go @@ -158,13 +158,13 @@ func (h *UiHook) PreApply(addr addrs.AbsResourceInstance, gen states.Generation, key := addr.String() uiState := uiResourceState{ - DispAddr: key, - IDKey: idKey, - IDValue: idValue, - Op: op, - Start: time.Now().Round(time.Second), - DoneCh: make(chan struct{}), - done: make(chan struct{}), + DispAddr: key, + IDKey: idKey, + IDValue: idValue, + Op: op, + Start: time.Now().Round(time.Second), + DoneCh: make(chan struct{}), + done: make(chan struct{}), } h.l.Lock() diff --git a/command/import_test.go b/command/import_test.go index 148182147..dfef0bc00 100644 --- a/command/import_test.go +++ b/command/import_test.go @@ -38,7 +38,7 @@ func TestImport(t *testing.T) { ImportedResources: []providers.ImportedResource{ { TypeName: "test_instance", - State: cty.ObjectVal(map[string]cty.Value{ + State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yay"), }), }, @@ -80,7 +80,7 @@ func TestImport_providerConfig(t *testing.T) { ImportedResources: []providers.ImportedResource{ { TypeName: "test_instance", - State: cty.ObjectVal(map[string]cty.Value{ + State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yay"), }), }, @@ -172,7 +172,7 @@ func TestImport_remoteState(t *testing.T) { ImportedResources: []providers.ImportedResource{ { TypeName: "test_instance", - State: cty.ObjectVal(map[string]cty.Value{ + State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yay"), }), }, @@ -236,7 +236,7 @@ func TestImport_providerConfigWithVar(t *testing.T) { ImportedResources: []providers.ImportedResource{ { TypeName: "test_instance", - State: cty.ObjectVal(map[string]cty.Value{ + State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yay"), }), }, @@ -295,7 +295,7 @@ func TestImport_providerConfigWithVarDefault(t *testing.T) { ImportedResources: []providers.ImportedResource{ { TypeName: "test_instance", - State: cty.ObjectVal(map[string]cty.Value{ + State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yay"), }), }, @@ -353,7 +353,7 @@ func TestImport_providerConfigWithVarFile(t *testing.T) { ImportedResources: []providers.ImportedResource{ { TypeName: "test_instance", - State: cty.ObjectVal(map[string]cty.Value{ + State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yay"), }), }, @@ -412,7 +412,7 @@ func TestImport_customProvider(t *testing.T) { ImportedResources: []providers.ImportedResource{ { TypeName: "test_instance", - State: cty.ObjectVal(map[string]cty.Value{ + State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yay"), }), }, @@ -455,7 +455,7 @@ func TestImport_allowMissingResourceConfig(t *testing.T) { ImportedResources: []providers.ImportedResource{ { TypeName: "test_instance", - State: cty.ObjectVal(map[string]cty.Value{ + State: cty.ObjectVal(map[string]cty.Value{ "id": cty.StringVal("yay"), }), }, diff --git a/command/meta_config.go b/command/meta_config.go index fb3491b6c..a3095b1f3 100644 --- a/command/meta_config.go +++ b/command/meta_config.go @@ -9,9 +9,9 @@ import ( "github.com/hashicorp/hcl2/hcl/hclsyntax" "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs/configload" + "github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/tfdiags" "github.com/zclconf/go-cty/cty" diff --git a/command/meta_vars.go b/command/meta_vars.go index ff68d50e4..8646e2843 100644 --- a/command/meta_vars.go +++ b/command/meta_vars.go @@ -114,7 +114,6 @@ func (m *Meta) collectVariableValues() (map[string]backend.UnparsedVariableValue return ret, diags } - func (m *Meta) addVarsFromFile(filename string, sourceType terraform.ValueSourceType, to map[string]backend.UnparsedVariableValue) tfdiags.Diagnostics { var diags tfdiags.Diagnostics @@ -213,7 +212,7 @@ func (v unparsedVariableValueString) ParseVariableValue(mode configs.VariablePar diags = diags.Append(hclDiags) return &terraform.InputValue{ - Value: val, - SourceType: v.sourceType, + Value: val, + SourceType: v.sourceType, }, diags } diff --git a/command/validate_test.go b/command/validate_test.go index 7ab8f02b5..1cb5ff750 100644 --- a/command/validate_test.go +++ b/command/validate_test.go @@ -9,8 +9,8 @@ import ( "github.com/zclconf/go-cty/cty" "github.com/hashicorp/terraform/configs/configschema" - "github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/helper/copy" + "github.com/hashicorp/terraform/terraform" ) func setupTest(fixturepath string, args ...string) (*cli.MockUi, int) {