mirror of
https://github.com/fumiama/deepinfra.git
synced 2026-06-21 12:21:37 +08:00
fix(utils): empty response on absense of sep
This commit is contained in:
@@ -12,7 +12,7 @@ func CutLast(txt, sep string) string {
|
|||||||
}
|
}
|
||||||
a := strings.LastIndex(txt, sep)
|
a := strings.LastIndex(txt, sep)
|
||||||
if a < 0 {
|
if a < 0 {
|
||||||
return ""
|
return strings.TrimSpace(txt)
|
||||||
}
|
}
|
||||||
a += len(sep)
|
a += len(sep)
|
||||||
if a >= len(txt) {
|
if a >= len(txt) {
|
||||||
|
|||||||
Reference in New Issue
Block a user