mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-01-23 02:35:10 +00:00
chore: fix golangci-lint errors
This commit is contained in:
parent
d194d71293
commit
ae0af1f996
54 changed files with 452 additions and 475 deletions
|
|
@ -119,7 +119,7 @@ func parseWindowsCommand(cmd string) []string {
|
|||
continue
|
||||
}
|
||||
|
||||
if unicode.IsSpace(ch) && !inQuotes && len(part) > 0 {
|
||||
if unicode.IsSpace(ch) && !inQuotes && part != "" {
|
||||
parts = append(parts, part)
|
||||
part = ""
|
||||
continue
|
||||
|
|
@ -128,7 +128,7 @@ func parseWindowsCommand(cmd string) []string {
|
|||
part += string(ch)
|
||||
}
|
||||
|
||||
if len(part) > 0 {
|
||||
if part != "" {
|
||||
parts = append(parts, part)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -125,7 +125,6 @@ func TestParseWindowsCommand(t *testing.T) {
|
|||
input: `cmd "a ""quoted value"`,
|
||||
expected: []string{`cmd`, `a "quoted value`},
|
||||
},
|
||||
// TODO - see how many quotes are displayed if we use "", """, """""""
|
||||
{ // 9 - two quotes outside an inQuote element
|
||||
input: `cmd a ""quoted value`,
|
||||
expected: []string{`cmd`, `a`, `"quoted`, `value`},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue