-
Notifications
You must be signed in to change notification settings - Fork 42
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
add global property for Var #370
Conversation
var globalVar2 string = time.Now().String() // want `\Qglobal var` | ||
var globalVar3 = time.Now().String() // want `\Qglobal var` | ||
var _ = time.Now().String() // false negative // TODO https://github.com/quasilyte/go-ruleguard/issues/369 | ||
var _ string = time.Now().String() // false negative // TODO https://github.com/quasilyte/go-ruleguard/issues/369 |
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 think all _
share the same "object" (none, nil object).
So they define "nothing".
Since you basically should use this IsGlobal
not for a declaration but rather for the usage of some variable, I don't think these cases matter here.
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.
We can't have different types for nil object either. Simply because there is nothing to associate a type with.
The code is good. |
The new dsl version is |
No description provided.