ok pattern
1995parham opened this issue · comments
Parham Alvani commented
There are cases like:
id, ok := claims["user_id"].(int)
if !ok {
}
which ok
is a known pattern.
Maik Schreiber commented
Good point. I've just added the -ignoreTypeAssertOk
flag that will allow to ignore ok
variables that hold the bool return value of a type assertion.
I will also add similar flags for the bool return values of channel receive and map index.
The ok
variable name will be hard-coded for the time being.
Parham Alvani commented
Thank you for your attention and work 👍