command: go fmt

This commit is contained in:
Martin Atkins 2018-10-14 07:59:15 -07:00
parent 53bb3f57e6
commit 73318a436b
7 changed files with 32 additions and 33 deletions

View File

@ -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{ return providers.PlanResourceChangeResponse{
PlannedState: req.ProposedNewState, PlannedState: req.ProposedNewState,
} }

View File

@ -182,15 +182,15 @@ func TestApply_parallelism(t *testing.T) {
provider := &terraform.MockProvider{} provider := &terraform.MockProvider{}
provider.GetSchemaReturn = &terraform.ProviderSchema{ provider.GetSchemaReturn = &terraform.ProviderSchema{
ResourceTypes: map[string]*configschema.Block{ 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{ return providers.PlanResourceChangeResponse{
PlannedState: req.ProposedNewState, 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 // Increment so we're counting parallelism
started <- 1 started <- 1
runCount.Inc() 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{ return providers.ApplyResourceChangeResponse{
NewState: req.PlannedState, 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{ return providers.ApplyResourceChangeResponse{
NewState: req.PlannedState, 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{ return providers.ApplyResourceChangeResponse{
NewState: req.PlannedState, 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{ return providers.ApplyResourceChangeResponse{
NewState: req.PlannedState, NewState: req.PlannedState,
} }
@ -1400,7 +1400,7 @@ func TestApply_backup(t *testing.T) {
if !cmp.Equal(actual, expected) { if !cmp.Equal(actual, expected) {
t.Fatalf( t.Fatalf(
"wrong aws_instance.foo state\n%s", "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) return string(b)
})), })),
) )
@ -1615,12 +1615,12 @@ func applyFixtureSchema() *terraform.ProviderSchema {
func applyFixtureProvider() *terraform.MockProvider { func applyFixtureProvider() *terraform.MockProvider {
p := testProvider() p := testProvider()
p.GetSchemaReturn = applyFixtureSchema() p.GetSchemaReturn = applyFixtureSchema()
p.PlanResourceChangeFn = func (req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse { p.PlanResourceChangeFn = func(req providers.PlanResourceChangeRequest) providers.PlanResourceChangeResponse {
return providers.PlanResourceChangeResponse{ return providers.PlanResourceChangeResponse{
PlannedState: req.ProposedNewState, PlannedState: req.ProposedNewState,
} }
} }
p.ApplyResourceChangeFn = func (req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse { p.ApplyResourceChangeFn = func(req providers.ApplyResourceChangeRequest) providers.ApplyResourceChangeResponse {
return providers.ApplyResourceChangeResponse{ return providers.ApplyResourceChangeResponse{
NewState: cty.UnknownAsNull(req.PlannedState), NewState: cty.UnknownAsNull(req.PlannedState),
} }

View File

@ -9,9 +9,9 @@ import (
"github.com/hashicorp/hcl2/hcl/hclsyntax" "github.com/hashicorp/hcl2/hcl/hclsyntax"
"github.com/hashicorp/hcl2/hcl" "github.com/hashicorp/hcl2/hcl"
"github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/configs" "github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/configs/configload" "github.com/hashicorp/terraform/configs/configload"
"github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform/tfdiags" "github.com/hashicorp/terraform/tfdiags"
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"

View File

@ -114,7 +114,6 @@ func (m *Meta) collectVariableValues() (map[string]backend.UnparsedVariableValue
return ret, diags return ret, diags
} }
func (m *Meta) addVarsFromFile(filename string, sourceType terraform.ValueSourceType, to map[string]backend.UnparsedVariableValue) tfdiags.Diagnostics { func (m *Meta) addVarsFromFile(filename string, sourceType terraform.ValueSourceType, to map[string]backend.UnparsedVariableValue) tfdiags.Diagnostics {
var diags tfdiags.Diagnostics var diags tfdiags.Diagnostics

View File

@ -9,8 +9,8 @@ import (
"github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/configs/configschema" "github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/terraform"
"github.com/hashicorp/terraform/helper/copy" "github.com/hashicorp/terraform/helper/copy"
"github.com/hashicorp/terraform/terraform"
) )
func setupTest(fixturepath string, args ...string) (*cli.MockUi, int) { func setupTest(fixturepath string, args ...string) (*cli.MockUi, int) {