Skip to content

Commit f9fabc6

Browse files
committed
Fix gofmt non-compliance
1 parent 65cf44f commit f9fabc6

File tree

2 files changed

+92
-92
lines changed

2 files changed

+92
-92
lines changed

es/resource_elasticsearch_index.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -413,12 +413,12 @@ var (
413413

414414
func resourceElasticsearchIndex() *schema.Resource {
415415
return &schema.Resource{
416-
Description: "Provides an Elasticsearch index resource.",
417-
Create: resourceElasticsearchIndexCreate,
418-
Read: resourceElasticsearchIndexRead,
419-
Update: resourceElasticsearchIndexUpdate,
420-
Delete: resourceElasticsearchIndexDelete,
421-
Schema: configSchema,
416+
Description: "Provides an Elasticsearch index resource.",
417+
Create: resourceElasticsearchIndexCreate,
418+
Read: resourceElasticsearchIndexRead,
419+
Update: resourceElasticsearchIndexUpdate,
420+
Delete: resourceElasticsearchIndexDelete,
421+
Schema: configSchema,
422422
CustomizeDiff: verifyIndexMappingUpdates,
423423
Importer: &schema.ResourceImporter{
424424
StateContext: schema.ImportStatePassthroughContext,
@@ -745,7 +745,7 @@ func updateIndexMappings(d *schema.ResourceData, meta interface{}, mapping strin
745745
_, err = client.PutMapping().Index(name).BodyString(mapping).Do(ctx)
746746
default:
747747
return errors.New("Elasticsearch version not supported")
748-
}
748+
}
749749

750750
return err
751751
}

es/resource_elasticsearch_index_test.go

Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -500,95 +500,95 @@ func TestAccElasticsearchIndex_doctype(t *testing.T) {
500500
}
501501

502502
func TestAccElasticsearchIndex_mapping(t *testing.T) {
503-
g := NewGomegaWithT(t)
504-
provider := Provider()
505-
diags := provider.Configure(context.Background(), &terraform.ResourceConfig{})
506-
if diags.HasError() {
507-
t.Skipf("err: %#v", diags)
508-
}
503+
g := NewGomegaWithT(t)
504+
provider := Provider()
505+
diags := provider.Configure(context.Background(), &terraform.ResourceConfig{})
506+
if diags.HasError() {
507+
t.Skipf("err: %#v", diags)
508+
}
509509

510-
var initialUUID string
511-
var err error
512-
513-
resource.Test(t, resource.TestCase{
514-
PreCheck: func() { testAccPreCheck(t) },
515-
Providers: testAccProviders,
516-
CheckDestroy: checkElasticsearchIndexDestroy,
517-
Steps: []resource.TestStep{
518-
{
519-
Config: testAccElasticsearchBasicMapping,
520-
Check: resource.ComposeTestCheckFunc(
521-
checkElasticsearchIndexMapping("terraform-test", func(s *terraform.State, mapping map[string]interface{}) error {
522-
initialUUID, err = getElasticsearchIndexUUID("elasticsearch_index.test_mapping", s)
523-
if err != nil {
524-
return fmt.Errorf("Failed to get index uuid: %w", err)
525-
}
526-
g.Expect(mapping).To(MatchAllKeys(Keys{
527-
"terraform-test": MatchAllKeys(Keys{
528-
"mappings": MatchAllKeys(Keys{
529-
"properties": MatchAllKeys(Keys{
530-
"age": MatchAllKeys(Keys{
531-
"type": Equal("integer"),
532-
}),
533-
"name": MatchAllKeys(Keys{
534-
"type": Equal("text"),
535-
}),
536-
}),
537-
}),
538-
}),
539-
}))
540-
return nil
541-
}),
542-
),
543-
},
544-
{
545-
Config: testAccElasticsearchAddedMapping,
546-
Check: resource.ComposeTestCheckFunc(
547-
checkElasticsearchIndexNotRecreated("elasticsearch_index.test_mapping", &initialUUID),
548-
checkElasticsearchIndexMapping("terraform-test", func(s *terraform.State, mapping map[string]interface{}) error {
549-
g.Expect(mapping).To(MatchAllKeys(Keys{
550-
"terraform-test": MatchAllKeys(Keys{
551-
"mappings": MatchAllKeys(Keys{
552-
"properties": MatchAllKeys(Keys{
553-
"age": MatchAllKeys(Keys{
554-
"type": Equal("integer"),
555-
}),
556-
"name": MatchAllKeys(Keys{
557-
"type": Equal("text"),
510+
var initialUUID string
511+
var err error
512+
513+
resource.Test(t, resource.TestCase{
514+
PreCheck: func() { testAccPreCheck(t) },
515+
Providers: testAccProviders,
516+
CheckDestroy: checkElasticsearchIndexDestroy,
517+
Steps: []resource.TestStep{
518+
{
519+
Config: testAccElasticsearchBasicMapping,
520+
Check: resource.ComposeTestCheckFunc(
521+
checkElasticsearchIndexMapping("terraform-test", func(s *terraform.State, mapping map[string]interface{}) error {
522+
initialUUID, err = getElasticsearchIndexUUID("elasticsearch_index.test_mapping", s)
523+
if err != nil {
524+
return fmt.Errorf("Failed to get index uuid: %w", err)
525+
}
526+
g.Expect(mapping).To(MatchAllKeys(Keys{
527+
"terraform-test": MatchAllKeys(Keys{
528+
"mappings": MatchAllKeys(Keys{
529+
"properties": MatchAllKeys(Keys{
530+
"age": MatchAllKeys(Keys{
531+
"type": Equal("integer"),
532+
}),
533+
"name": MatchAllKeys(Keys{
534+
"type": Equal("text"),
535+
}),
536+
}),
537+
}),
538+
}),
539+
}))
540+
return nil
558541
}),
559-
"surname": MatchAllKeys(Keys{
560-
"type": Equal("text"),
542+
),
543+
},
544+
{
545+
Config: testAccElasticsearchAddedMapping,
546+
Check: resource.ComposeTestCheckFunc(
547+
checkElasticsearchIndexNotRecreated("elasticsearch_index.test_mapping", &initialUUID),
548+
checkElasticsearchIndexMapping("terraform-test", func(s *terraform.State, mapping map[string]interface{}) error {
549+
g.Expect(mapping).To(MatchAllKeys(Keys{
550+
"terraform-test": MatchAllKeys(Keys{
551+
"mappings": MatchAllKeys(Keys{
552+
"properties": MatchAllKeys(Keys{
553+
"age": MatchAllKeys(Keys{
554+
"type": Equal("integer"),
555+
}),
556+
"name": MatchAllKeys(Keys{
557+
"type": Equal("text"),
558+
}),
559+
"surname": MatchAllKeys(Keys{
560+
"type": Equal("text"),
561+
}),
562+
}),
563+
}),
564+
}),
565+
}))
566+
return nil
561567
}),
562-
}),
563-
}),
564-
}),
565-
}))
566-
return nil
567-
}),
568-
),
569-
},
570-
{
571-
Config: testAccElasticsearchRemovedMapping,
572-
Check: resource.ComposeTestCheckFunc(
573-
checkElasticsearchIndexRecreated("elasticsearch_index.test_mapping", &initialUUID),
574-
checkElasticsearchIndexMapping("terraform-test", func(s *terraform.State, mapping map[string]interface{}) error {
575-
g.Expect(mapping).To(MatchAllKeys(Keys{
576-
"terraform-test": MatchAllKeys(Keys{
577-
"mappings": MatchAllKeys(Keys{
578-
"properties": MatchAllKeys(Keys{
579-
"name": MatchAllKeys(Keys{
580-
"type": Equal("text"),
568+
),
569+
},
570+
{
571+
Config: testAccElasticsearchRemovedMapping,
572+
Check: resource.ComposeTestCheckFunc(
573+
checkElasticsearchIndexRecreated("elasticsearch_index.test_mapping", &initialUUID),
574+
checkElasticsearchIndexMapping("terraform-test", func(s *terraform.State, mapping map[string]interface{}) error {
575+
g.Expect(mapping).To(MatchAllKeys(Keys{
576+
"terraform-test": MatchAllKeys(Keys{
577+
"mappings": MatchAllKeys(Keys{
578+
"properties": MatchAllKeys(Keys{
579+
"name": MatchAllKeys(Keys{
580+
"type": Equal("text"),
581+
}),
582+
}),
583+
}),
584+
}),
585+
}))
586+
return nil
581587
}),
582-
}),
583-
}),
584-
}),
585-
}))
586-
return nil
587-
}),
588-
),
589-
},
590-
},
591-
})
588+
),
589+
},
590+
},
591+
})
592592
}
593593

594594
func TestAccElasticsearchIndex_rolloverAliasXpack(t *testing.T) {

0 commit comments

Comments
 (0)