From 01a652a670671c326c543f411f0b645f18ded1d7 Mon Sep 17 00:00:00 2001 From: Taimoor Ahmad Date: Sun, 21 Jan 2024 13:19:56 -0500 Subject: [PATCH] fix if x == true and ST1005 error messages --- opslevel/common.go | 4 ++-- opslevel/datasource_opslevel_filter.go | 4 ++-- opslevel/datasource_opslevel_integration.go | 4 ++-- opslevel/datasource_opslevel_lifecycle.go | 4 ++-- opslevel/datasource_opslevel_rubric_category.go | 4 ++-- opslevel/datasource_opslevel_rubric_level.go | 4 ++-- opslevel/datasource_opslevel_tier.go | 4 ++-- opslevel/resource_opslevel_tag.go | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/opslevel/common.go b/opslevel/common.go index f9f06fd7..ad1b5e43 100644 --- a/opslevel/common.go +++ b/opslevel/common.go @@ -261,10 +261,10 @@ func flattenFilterPredicates(input []opslevel.FilterPredicate) []map[string]any if predicate.CaseSensitive == nil { o["case_sensitive"] = false o["case_insensitive"] = false - } else if *predicate.CaseSensitive == true { + } else if *predicate.CaseSensitive { o["case_sensitive"] = true o["case_insensitive"] = false - } else if *predicate.CaseSensitive == false { + } else if !*predicate.CaseSensitive { o["case_sensitive"] = false o["case_insensitive"] = true } diff --git a/opslevel/datasource_opslevel_filter.go b/opslevel/datasource_opslevel_filter.go index 49c956f8..eda0def0 100644 --- a/opslevel/datasource_opslevel_filter.go +++ b/opslevel/datasource_opslevel_filter.go @@ -23,7 +23,7 @@ func datasourceFilter() *schema.Resource { func filterFilters(data []opslevel.Filter, field string, value string) (*opslevel.Filter, error) { if value == "" { - return nil, fmt.Errorf("Please provide a non-empty value for filter's value") + return nil, fmt.Errorf("please provide a non-empty value for filter's value") } var output opslevel.Filter @@ -47,7 +47,7 @@ func filterFilters(data []opslevel.Filter, field string, value string) (*opsleve } if !found { - return nil, fmt.Errorf("Unable to find filter with: %s==%s", field, value) + return nil, fmt.Errorf("unable to find filter with: %s==%s", field, value) } return &output, nil } diff --git a/opslevel/datasource_opslevel_integration.go b/opslevel/datasource_opslevel_integration.go index 1fe9d9fc..a58aea88 100644 --- a/opslevel/datasource_opslevel_integration.go +++ b/opslevel/datasource_opslevel_integration.go @@ -23,7 +23,7 @@ func datasourceIntegration() *schema.Resource { func filterIntegrations(data []opslevel.Integration, field string, value string) (*opslevel.Integration, error) { if value == "" { - return nil, fmt.Errorf("Please provide a non-empty value for filter's value") + return nil, fmt.Errorf("please provide a non-empty value for filter's value") } var output opslevel.Integration @@ -47,7 +47,7 @@ func filterIntegrations(data []opslevel.Integration, field string, value string) } if !found { - return nil, fmt.Errorf("Unable to find integration with: %s==%s", field, value) + return nil, fmt.Errorf("unable to find integration with: %s==%s", field, value) } return &output, nil } diff --git a/opslevel/datasource_opslevel_lifecycle.go b/opslevel/datasource_opslevel_lifecycle.go index 278be061..ec22197e 100644 --- a/opslevel/datasource_opslevel_lifecycle.go +++ b/opslevel/datasource_opslevel_lifecycle.go @@ -32,7 +32,7 @@ func datasourceLifecycle() *schema.Resource { func filterLifecycles(data []opslevel.Lifecycle, field string, value string) (*opslevel.Lifecycle, error) { if value == "" { - return nil, fmt.Errorf("Please provide a non-empty value for filter's value") + return nil, fmt.Errorf("please provide a non-empty value for filter's value") } var output opslevel.Lifecycle @@ -66,7 +66,7 @@ func filterLifecycles(data []opslevel.Lifecycle, field string, value string) (*o } if !found { - return nil, fmt.Errorf("Unable to find lifecycle with: %s==%s", field, value) + return nil, fmt.Errorf("unable to find lifecycle with: %s==%s", field, value) } return &output, nil } diff --git a/opslevel/datasource_opslevel_rubric_category.go b/opslevel/datasource_opslevel_rubric_category.go index 3e5b36c4..c23145a0 100644 --- a/opslevel/datasource_opslevel_rubric_category.go +++ b/opslevel/datasource_opslevel_rubric_category.go @@ -23,7 +23,7 @@ func datasourceRubricCategory() *schema.Resource { func filterRubricCategories(levels *opslevel.CategoryConnection, field string, value string) (*opslevel.Category, error) { if value == "" { - return nil, fmt.Errorf("Please provide a non-empty value for filter's value") + return nil, fmt.Errorf("please provide a non-empty value for filter's value") } var output opslevel.Category @@ -47,7 +47,7 @@ func filterRubricCategories(levels *opslevel.CategoryConnection, field string, v } if !found { - return nil, fmt.Errorf("Unable to find category with: %s==%s", field, value) + return nil, fmt.Errorf("unable to find category with: %s==%s", field, value) } return &output, nil } diff --git a/opslevel/datasource_opslevel_rubric_level.go b/opslevel/datasource_opslevel_rubric_level.go index 429dbe2e..32ef526d 100644 --- a/opslevel/datasource_opslevel_rubric_level.go +++ b/opslevel/datasource_opslevel_rubric_level.go @@ -32,7 +32,7 @@ func datasourceRubricLevel() *schema.Resource { func filterRubricLevels(levels []opslevel.Level, field string, value string) (*opslevel.Level, error) { if value == "" { - return nil, fmt.Errorf("Please provide a non-empty value for filter's value") + return nil, fmt.Errorf("please provide a non-empty value for filter's value") } var output opslevel.Level @@ -66,7 +66,7 @@ func filterRubricLevels(levels []opslevel.Level, field string, value string) (*o } if !found { - return nil, fmt.Errorf("Unable to find level with: %s==%s", field, value) + return nil, fmt.Errorf("unable to find level with: %s==%s", field, value) } return &output, nil } diff --git a/opslevel/datasource_opslevel_tier.go b/opslevel/datasource_opslevel_tier.go index 4ebc3627..b109b227 100644 --- a/opslevel/datasource_opslevel_tier.go +++ b/opslevel/datasource_opslevel_tier.go @@ -32,7 +32,7 @@ func datasourceTier() *schema.Resource { func filterTiers(levels []opslevel.Tier, field string, value string) (*opslevel.Tier, error) { if value == "" { - return nil, fmt.Errorf("Please provide a non-empty value for filter's value") + return nil, fmt.Errorf("please provide a non-empty value for filter's value") } var output opslevel.Tier @@ -66,7 +66,7 @@ func filterTiers(levels []opslevel.Tier, field string, value string) (*opslevel. } if !found { - return nil, fmt.Errorf("Unable to find tier with: %s==%s", field, value) + return nil, fmt.Errorf("unable to find tier with: %s==%s", field, value) } return &output, nil } diff --git a/opslevel/resource_opslevel_tag.go b/opslevel/resource_opslevel_tag.go index e2fa341e..d37e385d 100644 --- a/opslevel/resource_opslevel_tag.go +++ b/opslevel/resource_opslevel_tag.go @@ -95,13 +95,13 @@ func resourceTagRead(d *schema.ResourceData, client *opslevel.Client) error { tags, err := resource.GetTags(client, nil) if err != nil { - return fmt.Errorf("Unable to get tags from '%s' with id '%s'", resourceType, resourceId) + return fmt.Errorf("unable to get tags from '%s' with id '%s'", resourceType, resourceId) } id := d.Id() tag, err := tags.GetTagById(*opslevel.NewID(id)) if err != nil || tag == nil { return fmt.Errorf( - "Tag '%s' for type %s with id '%s' not found. %s", + "tag '%s' for type %s with id '%s' not found. %s", id, resource.ResourceType(), resource.ResourceId(),