You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
chore: fix golangci-lint errors
This commit is contained in:
@@ -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`},
|
||||
|
||||
Reference in New Issue
Block a user