Skip to content

Commit

Permalink
Correct static checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Maria Alvarez committed Nov 10, 2021
1 parent c21db94 commit 66511aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/scalers/gcp_pub_sub_scaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
const (
defaultTargetSubscriptionSize = 5
pubSubStackDriverMetricName = "pubsub.googleapis.com/subscription/num_undelivered_messages"
compositeSubscriptionIdPrefix = "projects/[a-zA-Z0-9-]+/subscriptions/[a-zA-Z0-9-]+"
compositeSubscriptionIDPrefix = "projects/[a-zA-Z0-9-]+/subscriptions/[a-zA-Z0-9-]+"
)

type gcpAuthorizationMetadata struct {
Expand Down Expand Up @@ -171,8 +171,8 @@ func (s *pubsubScaler) GetSubscriptionSize(ctx context.Context) (int64, error) {
s.client = client
}
var subscriptionID string
var projectID string = ""
regexpExpression, _ := regexp.Compile(compositeSubscriptionIdPrefix)
var projectID string
regexpExpression, _ := regexp.Compile(compositeSubscriptionIDPrefix)
if regexpExpression.MatchString(s.metadata.subscriptionName) {
subscriptionID = strings.Split(s.metadata.subscriptionName, "/")[3]
projectID = strings.Split(s.metadata.subscriptionName, "/")[1]
Expand Down

0 comments on commit 66511aa

Please sign in to comment.