Skip to content

Commit

Permalink
Fix typos and made iterable parameters names more convinient
Browse files Browse the repository at this point in the history
  • Loading branch information
Gogen120 committed Apr 24, 2023
1 parent 44caf73 commit cdc9dfc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions selectel/dbaas.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,17 +427,17 @@ func resizeDatastore(ctx context.Context, d *schema.ResourceData, client *dbaas.
return nil
}

func containeDatastoreType(expectedTypes []string, datastoreType string) bool {
for _, dt := range expectedTypes {
if dt == datastoreType {
func containDatastoreType(expectedTypes []string, datastoreType string) bool {
for _, expectedType := range expectedTypes {
if expectedType == datastoreType {
return true
}
}

return false
}

func buildDatastoreTypeErrorMEssage(expectedDatastoreTypeEngines []string, datastoreTypeEngine string) string {
func buildDatastoreTypeErrorMessage(expectedDatastoreTypeEngines []string, datastoreTypeEngine string) string {
var baseMessage string
if len(expectedDatastoreTypeEngines) > 1 {
baseMessage = "Provided datastore type must have one of the following engine types: "
Expand All @@ -453,8 +453,8 @@ func validateDatastoreType(ctx context.Context, expectedDatastoreTypeEngines []s
if err != nil {
return diag.FromErr(errors.New("Couldnt get datastore type with id" + typeID))
}
if !containeDatastoreType(expectedDatastoreTypeEngines, datastoreType.Engine) {
return diag.FromErr(errors.New(buildDatastoreTypeErrorMEssage(expectedDatastoreTypeEngines, datastoreType.Engine)))
if !containDatastoreType(expectedDatastoreTypeEngines, datastoreType.Engine) {
return diag.FromErr(errors.New(buildDatastoreTypeErrorMessage(expectedDatastoreTypeEngines, datastoreType.Engine)))
}

return nil
Expand Down

0 comments on commit cdc9dfc

Please sign in to comment.