You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
funcfoo(pathstring) {
ifpath[0] =='/' { // here we are checking if first character is a slash// whatever
}
// ...
}
foo("/path/foo/bar)
foo("path/foo/bar)
The following code should be preferred and suggested
func foo(path string) {
if path[len(path)-1] == '/' { // here we are checking if last character is a slash
// whatever
}
// ...
}
foo("/path/bar/")
foo("/path/bar")
I faced to following piece of advice in recent code review
Please consider the following pseudocode
The following code should be preferred and suggested
This rule someone completes S1017
The pattern is very common:
The text was updated successfully, but these errors were encountered: