-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Remove hardcoded "/" #1984
Remove hardcoded "/" #1984
Conversation
There is also strings.Split -> path.Segments. |
(in #1984, stating '/' directly is a crime) |
License: MIT Signed-off-by: rht <[email protected]>
License: MIT Signed-off-by: rht <[email protected]>
Somehow the tests passed. |
cmd = cmd.Subcommand(name) | ||
|
||
if cmd == nil { | ||
pathS := strings.Join(path[0:i], "/") | ||
pathS := path.Join(pth[0:i]) |
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 know you didnt add it, but that [0:i]
not being just [:i]
is bothering me
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.
There are 6 occurences of '[0:'. Purging them once for all.
LGTM |
License: MIT Signed-off-by: rht <[email protected]>
this LGTM. thanks @rht |
Just small fixes.
Another option, it would be faster to just use strings.Join(elms, "/") and put it in path/path.go, since golang's path does path.Clean of every elements.