Skip to content

Commit a8531f3

Browse files
author
Pedro Montiel
committed
add ValidateFunc: validation.StringIsNotEmpty to tags
1 parent fc12218 commit a8531f3

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

sumologic/resource_sumologic_cse_aggregation_rule.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sumologic
22

33
import (
44
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
5+
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
56
"log"
67
)
78

@@ -85,7 +86,8 @@ func resourceSumologicCSEAggregationRule() *schema.Resource {
8586
Type: schema.TypeList,
8687
Optional: true,
8788
Elem: &schema.Schema{
88-
Type: schema.TypeString,
89+
Type: schema.TypeString,
90+
ValidateFunc: validation.StringIsNotEmpty,
8991
},
9092
},
9193
"trigger_expression": {

sumologic/resource_sumologic_cse_chain_rule.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sumologic
22

33
import (
44
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
5+
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
56
"log"
67
)
78

@@ -73,7 +74,8 @@ func resourceSumologicCSEChainRule() *schema.Resource {
7374
Type: schema.TypeList,
7475
Optional: true,
7576
Elem: &schema.Schema{
76-
Type: schema.TypeString,
77+
Type: schema.TypeString,
78+
ValidateFunc: validation.StringIsNotEmpty,
7779
},
7880
},
7981
"window_size": {

sumologic/resource_sumologic_cse_match_rule.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sumologic
22

33
import (
44
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
5+
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
56
"log"
67
)
78

@@ -50,7 +51,8 @@ func resourceSumologicCSEMatchRule() *schema.Resource {
5051
Type: schema.TypeList,
5152
Optional: true,
5253
Elem: &schema.Schema{
53-
Type: schema.TypeString,
54+
Type: schema.TypeString,
55+
ValidateFunc: validation.StringIsNotEmpty,
5456
},
5557
},
5658
},

sumologic/resource_sumologic_cse_threshold_rule.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sumologic
22

33
import (
44
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
5+
"github.com/hashicorp/terraform-plugin-sdk/helper/validation"
56
"log"
67
)
78

@@ -69,7 +70,8 @@ func resourceSumologicCSEThresholdRule() *schema.Resource {
6970
Type: schema.TypeList,
7071
Optional: true,
7172
Elem: &schema.Schema{
72-
Type: schema.TypeString,
73+
Type: schema.TypeString,
74+
ValidateFunc: validation.StringIsNotEmpty,
7375
},
7476
},
7577
"window_size": {

sumologic/sumologic_cse_rule_common.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ func resourceToStringArray(resourceStrings []interface{}) []string {
7171
result := make([]string, len(resourceStrings))
7272

7373
for i, resourceString := range resourceStrings {
74-
if resourceString != nil {
75-
result[i] = resourceString.(string)
76-
}
74+
result[i] = resourceString.(string)
7775
}
7876

7977
return result

0 commit comments

Comments
 (0)