-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable gocritic Linter in golangcli.yml #1383
Conversation
Hi @zroubalik @ahmelsayed @tomkerkhove @jeffhollan |
adapter/main.go
Outdated
@@ -113,7 +120,6 @@ func main() { | |||
|
|||
logger.Info(cmd.Message) | |||
if err := cmd.Run(wait.NeverStop); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err :=
this will use a new variable for err
not the one defined at the top of the main(){}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @zroubalik for taking look in this.
Just want to know that is this expecting behaviour you have mentioned above
if err = cmd.Run(wait.NeverStop); err != nil {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
pkg/scalers/azure_blob_scaler.go
Outdated
@@ -91,7 +91,8 @@ func parseAzureBlobMetadata(config *ScalerConfig) (*azureBlobMetadata, kedav1alp | |||
|
|||
// If the Use AAD Pod Identity is not present, or set to "none" | |||
// then check for connection string | |||
if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone { | |||
switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rewrite this switch to actually switch over config.PodIdentity
?
@@ -104,8 +104,8 @@ func NewAzureLogAnalyticsScaler(config *ScalerConfig) (Scaler, error) { | |||
|
|||
func parseAzureLogAnalyticsMetadata(config *ScalerConfig) (*azureLogAnalyticsMetadata, error) { | |||
meta := azureLogAnalyticsMetadata{} | |||
|
|||
if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone { | |||
switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rewrite this switch to actually switch over config.PodIdentity?
pkg/scalers/azure_queue_scaler.go
Outdated
@@ -80,7 +80,8 @@ func parseAzureQueueMetadata(config *ScalerConfig) (*azureQueueMetadata, kedav1a | |||
|
|||
// If the Use AAD Pod Identity is not present, or set to "none" | |||
// then check for connection string | |||
if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone { | |||
switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rewrite this switch to actually switch over config.PodIdentity?
@@ -102,8 +102,8 @@ func parseAzureServiceBusMetadata(config *ScalerConfig) (*azureServiceBusMetadat | |||
if meta.entityType == none { | |||
return nil, fmt.Errorf("no service bus entity type set") | |||
} | |||
|
|||
if config.PodIdentity == "" || config.PodIdentity == kedav1alpha1.PodIdentityProviderNone { | |||
switch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rewrite this switch to actually switch over config.PodIdentity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do this.
…ments Signed-off-by: Shubham82 <[email protected]>
Hi @zroubalik |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Shubham82 [email protected]
Provide a description of what has been changed
This PR enable gocritic in .golangcli.yml and remove all the lint errors or warnings which shown on running golangci-lint run.
Checklist
PartiallyFixes #1158