From 48ef7ecfa6dccb9802b25645e6bf3d6d16a160c9 Mon Sep 17 00:00:00 2001 From: Sander van Harmelen Date: Wed, 17 Oct 2018 23:05:57 +0200 Subject: [PATCH] Updates after running `make fmt` with Go v1.11.1 --- backend/local/backend_local.go | 3 +-- backend/local/testing.go | 2 +- backend/remote-state/s3/backend_test.go | 4 ++-- command/format/object_id_test.go | 14 +++++++------- helper/resource/grpc_test_provider.go | 2 +- helper/resource/testing_config.go | 2 +- tfdiags/contextual.go | 2 +- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/backend/local/backend_local.go b/backend/local/backend_local.go index 11ddff77d0..6480824723 100644 --- a/backend/local/backend_local.go +++ b/backend/local/backend_local.go @@ -1,12 +1,11 @@ package local import ( - "log" "context" "fmt" + "log" "github.com/hashicorp/errwrap" - "github.com/hashicorp/terraform/backend" "github.com/hashicorp/terraform/command/clistate" "github.com/hashicorp/terraform/configs/configload" diff --git a/backend/local/testing.go b/backend/local/testing.go index 38a2da2219..bc833dc999 100644 --- a/backend/local/testing.go +++ b/backend/local/testing.go @@ -130,4 +130,4 @@ func testTempDir(t *testing.T) string { func testStateFile(t *testing.T, path string, s *states.State) { stateFile := statemgr.NewFilesystem(path) stateFile.WriteState(s) -} \ No newline at end of file +} diff --git a/backend/remote-state/s3/backend_test.go b/backend/remote-state/s3/backend_test.go index 914f91bae1..be711884df 100644 --- a/backend/remote-state/s3/backend_test.go +++ b/backend/remote-state/s3/backend_test.go @@ -254,8 +254,8 @@ func TestBackendPrefixInWorkspace(t *testing.T) { bucketName := fmt.Sprintf("terraform-remote-s3-test-%x", time.Now().Unix()) b := backend.TestBackendConfig(t, New(), backend.TestWrapConfig(map[string]interface{}{ - "bucket": bucketName, - "key": "test-env.tfstate", + "bucket": bucketName, + "key": "test-env.tfstate", "workspace_key_prefix": "env", })).(*Backend) diff --git a/command/format/object_id_test.go b/command/format/object_id_test.go index b562234fec..d9c7912149 100644 --- a/command/format/object_id_test.go +++ b/command/format/object_id_test.go @@ -8,7 +8,7 @@ import ( ) func TestObjectValueIDOrName(t *testing.T) { - tests := []struct{ + tests := []struct { obj cty.Value id [2]string name [2]string @@ -34,7 +34,7 @@ func TestObjectValueIDOrName(t *testing.T) { }, { cty.ObjectVal(map[string]cty.Value{ - "id": cty.StringVal("foo-123"), + "id": cty.StringVal("foo-123"), }), [...]string{"id", "foo-123"}, [...]string{"", ""}, @@ -95,7 +95,7 @@ func TestObjectValueIDOrName(t *testing.T) { // in this formatter, this is the place to add a new test case. { cty.ObjectVal(map[string]cty.Value{ - "id": cty.True, + "id": cty.True, }), [...]string{"", ""}, [...]string{"", ""}, @@ -103,7 +103,7 @@ func TestObjectValueIDOrName(t *testing.T) { }, { cty.ObjectVal(map[string]cty.Value{ - "id": cty.NullVal(cty.String), + "id": cty.NullVal(cty.String), }), [...]string{"", ""}, [...]string{"", ""}, @@ -111,7 +111,7 @@ func TestObjectValueIDOrName(t *testing.T) { }, { cty.ObjectVal(map[string]cty.Value{ - "id": cty.UnknownVal(cty.String), + "id": cty.UnknownVal(cty.String), }), [...]string{"", ""}, [...]string{"", ""}, @@ -172,9 +172,9 @@ func TestObjectValueIDOrName(t *testing.T) { [...]string{"", ""}, }, } - + for _, test := range tests { - t.Run(fmt.Sprintf("%#v", test.obj), func (t *testing.T) { + t.Run(fmt.Sprintf("%#v", test.obj), func(t *testing.T) { obj := test.obj gotIDKey, gotIDVal := ObjectValueID(obj) gotNameKey, gotNameVal := ObjectValueName(obj) diff --git a/helper/resource/grpc_test_provider.go b/helper/resource/grpc_test_provider.go index 5f7cbe47b3..d2b12b4edd 100644 --- a/helper/resource/grpc_test_provider.go +++ b/helper/resource/grpc_test_provider.go @@ -5,13 +5,13 @@ import ( "net" "time" - "google.golang.org/grpc/test/bufconn" "github.com/hashicorp/terraform/helper/plugin" tfplugin "github.com/hashicorp/terraform/plugin" "github.com/hashicorp/terraform/plugin/proto" "github.com/hashicorp/terraform/providers" "github.com/hashicorp/terraform/terraform" "google.golang.org/grpc" + "google.golang.org/grpc/test/bufconn" ) // GRPCTestProvider takes a legacy ResourceProvider, wraps it in the new GRPC diff --git a/helper/resource/testing_config.go b/helper/resource/testing_config.go index 11770c6c59..ea1f412989 100644 --- a/helper/resource/testing_config.go +++ b/helper/resource/testing_config.go @@ -1,9 +1,9 @@ package resource import ( - "errors" "bufio" "bytes" + "errors" "fmt" "log" "sort" diff --git a/tfdiags/contextual.go b/tfdiags/contextual.go index 517c7a27c9..a7e4e7d9aa 100644 --- a/tfdiags/contextual.go +++ b/tfdiags/contextual.go @@ -297,7 +297,7 @@ func WholeContainingBody(severity Severity, summary, detail string) Diagnostic { type wholeBodyDiagnostic struct { diagnosticBase - subject *SourceRange // populated only after ElaborateFromConfigBody + subject *SourceRange // populated only after ElaborateFromConfigBody } func (d *wholeBodyDiagnostic) ElaborateFromConfigBody(body hcl.Body) Diagnostic {