Fix drift caused from gofmt when running make dev and go 1.11.

A fresh checkout of `origin/master` does not build atm using the `dev`
target because `master` has not been formatted using `gofmt` from Go
1.11 (tis has been the case for a while if you've been running devel).

None of the drift in question is especially new but now that Go 1.11
has been released and gofmt's formatting guidelines have been updated,
it would be *really* nice if the code in `master` reflected the current
tooling in order to avoid having to fight this drift locally.

* 8mo: https://github.com/hashicorp/terraform/blame/master/backend/remote-state/s3/backend_test.go#L260-L261
* 6mo: https://github.com/hashicorp/terraform/blame/master/builtin/provisioners/chef/linux_provisioner_test.go#L124
* 1yr: 7cfeffe36b/command/init.go (L75-L76)
* 12d: 7cfeffe36b/command/meta_backend_test.go (L1437)
* 2yr: 7cfeffe36b/helper/schema/resource_timeout_test.go (L26)
* 4yr: 7cfeffe36b/helper/schema/schema_test.go (L2059)
* 1yr: 7cfeffe36b/plugin/discovery/get_test.go (L151)
This commit is contained in:
Sean Chittenden 2018-09-09 10:18:08 -07:00
parent 7cfeffe36b
commit d749420a25
No known key found for this signature in database
GPG Key ID: 4EBC9DC16C2E5E16
7 changed files with 15 additions and 15 deletions

View File

@ -257,8 +257,8 @@ func TestBackendPrefixInWorkspace(t *testing.T) {
bucketName := fmt.Sprintf("terraform-remote-s3-test-%x", time.Now().Unix()) bucketName := fmt.Sprintf("terraform-remote-s3-test-%x", time.Now().Unix())
b := backend.TestBackendConfig(t, New(), map[string]interface{}{ b := backend.TestBackendConfig(t, New(), map[string]interface{}{
"bucket": bucketName, "bucket": bucketName,
"key": "test-env.tfstate", "key": "test-env.tfstate",
"workspace_key_prefix": "env", "workspace_key_prefix": "env",
}).(*Backend) }).(*Backend)

View File

@ -121,7 +121,7 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
Commands: map[string]bool{ Commands: map[string]bool{
"curl -LO https://omnitruck.chef.io/install.sh": true, "curl -LO https://omnitruck.chef.io/install.sh": true,
"bash ./install.sh -v \"11.18.6\" -c stable": true, "bash ./install.sh -v \"11.18.6\" -c stable": true,
"rm -f install.sh": true, "rm -f install.sh": true,
}, },
}, },
@ -140,7 +140,7 @@ func TestResourceProvider_linuxInstallChefClient(t *testing.T) {
Commands: map[string]bool{ Commands: map[string]bool{
"curl -LO https://omnitruck.chef.io/install.sh": true, "curl -LO https://omnitruck.chef.io/install.sh": true,
"bash ./install.sh -v \"11.18.6\" -c current": true, "bash ./install.sh -v \"11.18.6\" -c current": true,
"rm -f install.sh": true, "rm -f install.sh": true,
}, },
}, },
} }

View File

@ -72,8 +72,8 @@ func (c *InitCommand) Run(args []string) int {
// set providerInstaller if we don't have a test version already // set providerInstaller if we don't have a test version already
if c.providerInstaller == nil { if c.providerInstaller == nil {
c.providerInstaller = &discovery.ProviderInstaller{ c.providerInstaller = &discovery.ProviderInstaller{
Dir: c.pluginDir(), Dir: c.pluginDir(),
Cache: c.pluginCache(), Cache: c.pluginCache(),
PluginProtocolVersion: plugin.Handshake.ProtocolVersion, PluginProtocolVersion: plugin.Handshake.ProtocolVersion,
SkipVerify: !flagVerifyPlugins, SkipVerify: !flagVerifyPlugins,
Ui: c.Ui, Ui: c.Ui,

View File

@ -1434,7 +1434,7 @@ func TestMetaBackend_configuredChangeCopy_multiToNoDefaultWithDefault(t *testing
// Ask input // Ask input
defer testInputMap(t, map[string]string{ defer testInputMap(t, map[string]string{
"backend-migrate-multistate-to-multistate": "yes", "backend-migrate-multistate-to-multistate": "yes",
"new-state-name": "env1", "new-state-name": "env1",
})() })()
// Setup the meta // Setup the meta

View File

@ -23,28 +23,28 @@ func TestResourceTimeout_ConfigDecode_badkey(t *testing.T) {
ShouldErr bool ShouldErr bool
}{ }{
{ {
Name: "Source does not define 'delete' key", Name: "Source does not define 'delete' key",
ResourceDefaultTimeout: timeoutForValues(10, 0, 5, 0, 0), ResourceDefaultTimeout: timeoutForValues(10, 0, 5, 0, 0),
Config: expectedConfigForValues(2, 0, 0, 1, 0), Config: expectedConfigForValues(2, 0, 0, 1, 0),
Expected: timeoutForValues(10, 0, 5, 0, 0), Expected: timeoutForValues(10, 0, 5, 0, 0),
ShouldErr: true, ShouldErr: true,
}, },
{ {
Name: "Config overrides create", Name: "Config overrides create",
ResourceDefaultTimeout: timeoutForValues(10, 0, 5, 0, 0), ResourceDefaultTimeout: timeoutForValues(10, 0, 5, 0, 0),
Config: expectedConfigForValues(2, 0, 7, 0, 0), Config: expectedConfigForValues(2, 0, 7, 0, 0),
Expected: timeoutForValues(2, 0, 7, 0, 0), Expected: timeoutForValues(2, 0, 7, 0, 0),
ShouldErr: false, ShouldErr: false,
}, },
{ {
Name: "Config overrides create, default provided. Should still have zero values", Name: "Config overrides create, default provided. Should still have zero values",
ResourceDefaultTimeout: timeoutForValues(10, 0, 5, 0, 3), ResourceDefaultTimeout: timeoutForValues(10, 0, 5, 0, 3),
Config: expectedConfigForValues(2, 0, 7, 0, 0), Config: expectedConfigForValues(2, 0, 7, 0, 0),
Expected: timeoutForValues(2, 0, 7, 0, 3), Expected: timeoutForValues(2, 0, 7, 0, 3),
ShouldErr: false, ShouldErr: false,
}, },
{ {
Name: "Use something besides 'minutes'", Name: "Use something besides 'minutes'",
ResourceDefaultTimeout: timeoutForValues(10, 0, 5, 0, 3), ResourceDefaultTimeout: timeoutForValues(10, 0, 5, 0, 3),
Config: []map[string]interface{}{ Config: []map[string]interface{}{
map[string]interface{}{ map[string]interface{}{

View File

@ -2056,7 +2056,7 @@ func TestSchemaMap_Diff(t *testing.T) {
State: &terraform.InstanceState{ State: &terraform.InstanceState{
Attributes: map[string]string{ Attributes: map[string]string{
"block_device.#": "2", "block_device.#": "2",
"block_device.616397234.delete_on_termination": "true", "block_device.616397234.delete_on_termination": "true",
"block_device.616397234.device_name": "/dev/sda1", "block_device.616397234.device_name": "/dev/sda1",
"block_device.2801811477.delete_on_termination": "true", "block_device.2801811477.delete_on_termination": "true",

View File

@ -148,7 +148,7 @@ func TestProviderInstallerGet(t *testing.T) {
// attempt to use an incompatible protocol version // attempt to use an incompatible protocol version
i := &ProviderInstaller{ i := &ProviderInstaller{
Dir: tmpDir, Dir: tmpDir,
PluginProtocolVersion: 5, PluginProtocolVersion: 5,
SkipVerify: true, SkipVerify: true,
Ui: cli.NewMockUi(), Ui: cli.NewMockUi(),
@ -159,7 +159,7 @@ func TestProviderInstallerGet(t *testing.T) {
} }
i = &ProviderInstaller{ i = &ProviderInstaller{
Dir: tmpDir, Dir: tmpDir,
PluginProtocolVersion: 3, PluginProtocolVersion: 3,
SkipVerify: true, SkipVerify: true,
Ui: cli.NewMockUi(), Ui: cli.NewMockUi(),
@ -231,7 +231,7 @@ func TestProviderInstallerPurgeUnused(t *testing.T) {
f.Close() f.Close()
i := &ProviderInstaller{ i := &ProviderInstaller{
Dir: tmpDir, Dir: tmpDir,
PluginProtocolVersion: 3, PluginProtocolVersion: 3,
SkipVerify: true, SkipVerify: true,
Ui: cli.NewMockUi(), Ui: cli.NewMockUi(),