From d4f30af42cd2c35f2376783b3f9ae9fa82407f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Tue, 7 Nov 2023 14:45:13 +0100 Subject: [PATCH] Format Go files --- consul/data_source_consul_key_prefix.go | 2 +- consul/data_source_consul_keys_test.go | 7 ------- consul/key_client.go | 6 +++--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/consul/data_source_consul_key_prefix.go b/consul/data_source_consul_key_prefix.go index ac1adf9e..2c5cb450 100644 --- a/consul/data_source_consul_key_prefix.go +++ b/consul/data_source_consul_key_prefix.go @@ -97,7 +97,7 @@ func dataSourceConsulKeyPrefixRead(d *schema.ResourceData, meta interface{}) err } fullPath := pathPrefix + path - _, value, _, err := keyClient.Get(fullPath) + _, value, _, err := keyClient.Get(fullPath) if err != nil { return err } diff --git a/consul/data_source_consul_keys_test.go b/consul/data_source_consul_keys_test.go index a2c62ee5..9f260777 100644 --- a/consul/data_source_consul_keys_test.go +++ b/consul/data_source_consul_keys_test.go @@ -10,9 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) - - - func TestAccDataConsulKeysNonExistentKeys(t *testing.T) { providers, _ := startTestServer(t) @@ -65,7 +62,6 @@ func TestAccDataConsulKeysExistentKeyWithEmptyValueAndDefault(t *testing.T) { }) } - func TestAccDataConsulKeys_basic(t *testing.T) { providers, _ := startTestServer(t) @@ -129,8 +125,6 @@ func TestAccDataConsulKeys_datacenter(t *testing.T) { }) } - - const testAccDataConsulKeysNonExistantKeyDefaultBehaviourConfig = ` data "consul_keys" "read" { @@ -156,7 +150,6 @@ data "consul_keys" "read" { } ` - const testAccDataConsulKeysNonExistantKeyWithDefaultConfig = ` data "consul_keys" "read" { diff --git a/consul/key_client.go b/consul/key_client.go index 8073c0b1..87cf173e 100644 --- a/consul/key_client.go +++ b/consul/key_client.go @@ -39,11 +39,11 @@ func (c *keyClient) Get(path string) (bool, string, int, error) { return false, "", 0, fmt.Errorf("failed to read Consul key '%s': %s", path, err) } value := "" - if pair == nil { + if pair == nil { return false, "", 0, nil - } + } - if pair != nil { + if pair != nil { value = string(pair.Value) }