mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 10:18:59 +02:00
fix(rules): prevent appending empty parts in splitPipe function
This commit is contained in:
@@ -604,7 +604,9 @@ func splitPipe(s string) []string {
|
|||||||
|
|
||||||
// drop trailing empty part.
|
// drop trailing empty part.
|
||||||
if start < len(s) {
|
if start < len(s) {
|
||||||
result = append(result, strings.TrimSpace(s[start:]))
|
if part := strings.TrimSpace(s[start:]); part != "" {
|
||||||
|
result = append(result, part)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user