Skip to content

Commit

Permalink
fix if x == true and ST1005 error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Taimoor Ahmad committed Jan 21, 2024
1 parent 56af2b4 commit 251cc46
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions opslevel/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions opslevel/datasource_opslevel_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions opslevel/datasource_opslevel_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions opslevel/datasource_opslevel_lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions opslevel/datasource_opslevel_rubric_category.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions opslevel/datasource_opslevel_rubric_level.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions opslevel/datasource_opslevel_tier.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions opslevel/resource_opslevel_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 251cc46

Please sign in to comment.