Skip to content

Commit

Permalink
Change strings.Index to strings.Contains
Browse files Browse the repository at this point in the history
It's more suitable. Also makes the linters happy.

Signed-off-by: Dimitrios Karagiannis <[email protected]>
  • Loading branch information
alkar committed Jan 27, 2020
1 parent 1abe7e2 commit 94ea155
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion megaport/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func validateAWSBGPAuthKey(v interface{}, k string) (warns []string, errs []erro
errs = append(errs, fmt.Errorf("%q must be between 6 and 24 characters long", k))
return
}
if strings.Index(vv, " ") != -1 {
if strings.Contains(vv, " ") {
errs = append(errs, fmt.Errorf("%q cannot contain any whitespace", k))
return
}
Expand Down

0 comments on commit 94ea155

Please sign in to comment.