My golint returns this error message but i don't really understand what it means.
As in title:
return statements should not be cuddled if block has more than two lines (wsl)
my code is this:
func validateCountry(product models.Product, countries []models.Country) bool {
if !product.CountryCode.Valid {
return true
}
for _, country := range countries {
if country.Code == product.CountryCode.String {
return !country.Enabled && country.Deprecated
}
}
return false
}
What the linter does not like seems to be the last return false.
I'm very confused, i didn't setup the linter in this codebase, and i don't really know how to either skip this rules or how to fix it.