core: A "go fmt" catchup

Since we started using experimental Go Modules our editor tooling hasn't
been fully functional, apparently including format-on-save support. This
is a catchup to get everything back straight again.
This commit is contained in:
Martin Atkins 2018-09-27 17:57:08 -07:00
parent eddc29d6e4
commit b229264bd6
9 changed files with 14 additions and 17 deletions

View File

@ -16,8 +16,8 @@ import (
"time"
"github.com/davecgh/go-spew/spew"
"github.com/google/go-cmp/cmp"
"github.com/go-test/deep"
"github.com/google/go-cmp/cmp"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/addrs"
@ -1493,7 +1493,7 @@ func TestContext2Apply_dataBasic(t *testing.T) {
p.DiffFn = testDiffFn
p.ReadDataSourceResponse = providers.ReadDataSourceResponse{
State: cty.ObjectVal(map[string]cty.Value{
"id": cty.StringVal("yo"),
"id": cty.StringVal("yo"),
"foo": cty.NullVal(cty.String),
}),
}
@ -2727,7 +2727,7 @@ func TestContext2Apply_orphanResource(t *testing.T) {
// At this point both resources should be recorded in the state, along
// with the single instance associated with test_thing.one.
want := states.BuildState(func (s *states.SyncState) {
want := states.BuildState(func(s *states.SyncState) {
providerAddr := addrs.ProviderConfig{
Type: "test",
}.Absolute(addrs.RootModuleInstance)
@ -2744,7 +2744,7 @@ func TestContext2Apply_orphanResource(t *testing.T) {
s.SetResourceMeta(zeroAddr, states.EachList, providerAddr)
s.SetResourceMeta(oneAddr, states.EachList, providerAddr)
s.SetResourceInstanceCurrent(oneAddr.Instance(addrs.IntKey(0)), &states.ResourceInstanceObjectSrc{
Status: states.ObjectReady,
Status: states.ObjectReady,
AttrsJSON: []byte(`{}`),
}, providerAddr)
})

View File

@ -38,7 +38,7 @@ func contextFixtureApplyVars(t *testing.T) *contextTestFixture {
c := testModule(t, "apply-vars")
p := mockProviderWithResourceTypeSchema("aws_instance", &configschema.Block{
Attributes: map[string]*configschema.Attribute{
"id": {Type: cty.String, Computed: true},
"id": {Type: cty.String, Computed: true},
"foo": {Type: cty.String, Optional: true},
"bar": {Type: cty.String, Optional: true},
"baz": {Type: cty.String, Optional: true},

View File

@ -10,19 +10,16 @@ import (
"sync"
"testing"
"github.com/hashicorp/terraform/config/hcl2shim"
"github.com/hashicorp/terraform/plans"
"github.com/hashicorp/terraform/states"
"github.com/davecgh/go-spew/spew"
"github.com/google/go-cmp/cmp"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/config/hcl2shim"
"github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/plans"
"github.com/hashicorp/terraform/providers"
"github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform/tfdiags"
)

View File

@ -3,9 +3,9 @@ package terraform
import (
"testing"
"github.com/zclconf/go-cty/cty"
"github.com/hashicorp/hcl2/hcl"
"github.com/hashicorp/hcl2/hcl/hclsyntax"
"github.com/zclconf/go-cty/cty"
)
func TestProcessIgnoreChangesIndividual(t *testing.T) {

View File

@ -54,7 +54,7 @@ func (b *DestroyPlanGraphBuilder) Steps() []GraphTransformer {
concreteResourceInstanceDeposed := func(a *NodeAbstractResourceInstance, key states.DeposedKey) dag.Vertex {
return &NodePlanDeposedResourceInstanceObject{
NodeAbstractResourceInstance: a,
DeposedKey: key,
DeposedKey: key,
}
}

View File

@ -72,7 +72,7 @@ func (b *PlanGraphBuilder) Steps() []GraphTransformer {
concreteResourceInstanceDeposed := func(a *NodeAbstractResourceInstance, key states.DeposedKey) dag.Vertex {
return &NodePlanDeposedResourceInstanceObject{
NodeAbstractResourceInstance: a,
DeposedKey: key,
DeposedKey: key,
}
}

View File

@ -82,7 +82,7 @@ func (b *RefreshGraphBuilder) Steps() []GraphTransformer {
// The "Plan" node type also handles refreshing behavior.
return &NodePlanDeposedResourceInstanceObject{
NodeAbstractResourceInstance: a,
DeposedKey: key,
DeposedKey: key,
}
}

View File

@ -2,8 +2,8 @@ package terraform
import (
"github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/configs"
"github.com/hashicorp/terraform/configs/configschema"
"github.com/hashicorp/terraform/dag"
)

View File

@ -22,7 +22,7 @@ import (
type NodeApplyableResourceInstance struct {
*NodeAbstractResourceInstance
destroyNode GraphNodeDestroyerCBD
destroyNode GraphNodeDestroyerCBD
graphNodeDeposer // implementation of GraphNodeDeposer
}