-
Couldn't load subscription status.
- Fork 104
sample_driver: fix issue #116 : handle of LIST command #123
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
sample_driver: fix issue #116 : handle of LIST command #123
Conversation
| } | ||
|
|
||
| files, err := ioutil.ReadDir(directory) | ||
| dir := filepath.Join(driver.BaseDir, directory) |
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.
assignments should only be cuddled with other assignments (from wsl)
| } | ||
| return strings.ReplaceAll(s, "\"", `""`) | ||
|
|
||
| } |
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.
block should not end with a whitespace (or comment) (from wsl)
server/handle_dirs.go
Outdated
| if strings.Index(s, "\"") == -1 { | ||
| return s | ||
| } | ||
| return strings.ReplaceAll(s, "\"", `""`) |
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.
return statements should not be cuddled if block has more than two lines (from wsl)
| type args struct { | ||
| s string | ||
| } | ||
| tests := []struct { |
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.
assignments should only be cuddled with other assignments (from wsl)
| {"1", args{` one" quote`}, ` one"" quote`}, | ||
| {"1", args{` two"" quote`}, ` two"""" quote`}, | ||
| } | ||
| for _, tt := range tests { |
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.
only one cuddle assignment allowed before range statement (from wsl)
| return s | ||
| } | ||
| return strings.ReplaceAll(s, "\"", `""`) | ||
|
|
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.
unnecessary trailing newline (from whitespace)
server/server_test.go
Outdated
| } | ||
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| if got := qoutedoubling(tt.args.s); got != tt.want { |
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.
Using the variable on range scope tt in function literal (from scopelint)
server/server_test.go
Outdated
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| if got := qoutedoubling(tt.args.s); got != tt.want { | ||
| t.Errorf("qoutedoubling() = %v, want %v", got, tt.want) |
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.
Using the variable on range scope tt in function literal (from scopelint)
| "gopkg.in/dutchcoders/goftp.v1" | ||
|
|
||
| "github.com/fclairamb/ftpserver/server" | ||
| "gopkg.in/dutchcoders/goftp.v1" |
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.
File is not goimports-ed with -local github.com/fclairamb/ftpserver (from goimports)
| "gopkg.in/dutchcoders/goftp.v1" | |
| "gopkg.in/dutchcoders/goftp.v1" | |
| "github.com/fclairamb/ftpserver/server" |
server/handle_dirs.go
Outdated
| } | ||
|
|
||
| func qoutedoubling(s string) string { | ||
| if strings.Index(s, "\"") == -1 { |
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.
S1003: should use !strings.Contains(s, """) instead (from gosimple)
prepare.bat
Outdated
| @@ -0,0 +1,7 @@ | |||
| go get -t -v | |||
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.
Please remove this file
server/handle_dirs.go
Outdated
| ) | ||
| } | ||
|
|
||
| func qoutedoubling(s string) string { |
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.
Please rename it quoteDoubling
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.
@zavla you still haven't fixed that
| if fileName == " with spaces " { | ||
| expectedfileName := " with spaces " | ||
| if runtime.GOOS == "windows" { | ||
| expectedfileName = " with spaces" |
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.
Is it not possible to have a space at the end of a file in windows ?
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.
Hello. No, such files are inaccessible.
https://docs.microsoft.com/en-gb/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#naming_conventions
Do not end a file or directory name with a space or a period. Although the underlying file system may support such names, the Windows shell and user interface does not.
|
These changes seem reasonable for the most part. What is blocking the build is that you are using |
|
@zavla there's still written |
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.
LGTM
No description provided.